Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use userAgent or appVersion to track visiting browsers to my website?

As web browsing continues to change due to apps with "web view" widgets, tablets, etc., I want to track hits to my website based on browser-type so I can proactively tailor content and presentation.

When I examine a small handful of web browsers from iPad, Android, Macbook, iPad and others, it appears that the userAgent is simply the appCodeName concatenated with appVersion.

Is that always true? Can I rely on it for presentation (i.e., CSS) decisions?

Any other issues to consider?

like image 392
mobibob Avatar asked Nov 04 '22 23:11

mobibob


1 Answers

I think it's better to use a browser detection mechanism like WURFL(Wireless Universal Resource File). This is an XML file (and now a DB file) and various DBI libraries that not only contain up-to-date wireless user-agent data, but also what features and capabilities those user-agents support.

And Detect Mobile Browser that do this in Apache, ASP, ColdFusion, JavaScript and PHP.

like image 132
Faraz Kelhini Avatar answered Nov 09 '22 15:11

Faraz Kelhini