javascript - Detecting device brand -
i working on web analytics. using javascript client-side , nodejs server-side. know can find out device type using useragent
, how detect device brand (client or server side)?
you can't directly; useragent field not contain vendor. can build library of useragent tokens map particular vendors. involve lot of research , testing on wide range of devices, though.
for example, "ios", "iphone" or "ipad" in useragent can safely map "apple". samsung galaxy s3, example, has model number in useragent, "gt-i9300". can map "samsung". ...and you'd need repeat every other device want recognise. looking user agent strings online quickest way.
Comments
Post a Comment