Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript Detection / Browser Statistics

This has been asked few times but I think it's still worth checking with you guys for some more input.

All my websites use Google Analytics for stats. Since it relies on JavaScript I thought it was important for me to check how many people actually have JS enabled in their browsers enabled/disabled.

I remember I usually checked w3schools browser statistics, and recent results show something around 95% which was quite satisfactory for me. But since it applies purely on their website, I thought I'd check what was it on mine. I tried few methods but recently I count all page views and all downloads of my main.js file (caching prevented by "cache killer" variable added to file path). This method has few drawbacks, since it doesn't recognise google's robot (or any other), but it's still accurate enough.

Surprisingly only 68% of people visiting my biggest website has JS enabled (other methods - e.g. using cookies - I tried showed similar number). I'd love to be told that my method is completely wrong and that's why the number is so low.

Since I build websites that don't rely on JS to work, that's still ok from functional point of view, but this also means that 32% of entries to my websites are being counted by Analytics! That's a huge drawback.

Is there any other website (other than w3schools) that shares their stats? Or a survey I could compare my numbers to? Maybe even some of you could share yours?

Now I am considering creating my own stats engine. But is there any other (than Analytics) reliable (and free) stats solution you could suggest? One that would actually check if people have JS enabled?

Any suggestions on JS detection are also more than welcome.

like image 293
Michal M Avatar asked Jun 12 '09 09:06

Michal M


People also ask

Can JavaScript do browser detection?

How to detect the user browser ( Safari, Chrome, IE, Firefox and Opera ) using JavaScript ? The browser on which the current page is opening can be checked using JavaScript. The userAgent property of the navigator object is used to return the user-agent header string sent by the browser.

Which JavaScript is used for browser detection?

JavaScript has a standard object called navigator that contains data about the browser being used. The navigator object has a lot of properties, but the . userAgent property — a string that contains data about the browser, operating system, and more– is all we'll need.

How can you detect the client's browser name in JavaScript?

Answer: To establish the actual name of the user's Web browser, you can use the navigator. appName and navigator. userAgent properties.

How do you determine which browser is being used?

In the browser's toolbar, click on “Help"or the Settings icon. Click the menu option that begins “About” and you'll see what type and version of browser you are using.


2 Answers

Is there any other website (other than w3schools) that shares their stats?

Thecounter.com has a couple statistical analysis: http://www.thecounter.com/stats/

Here is a link with javascript stats from March 2009.

Javascript 1.2+: 61865673 (93%)
Javascript <1.2: 112854 (0%)
Javascript false: 4393090 (6%)

Or a survey I could compare my numbers to?

My recommandation would be to make your own stats. Your own users are the ones that matter. For instance building an website for people with accesibility issues or one for a mobile device would mean that you're not expecting too many visits with js enabled.

But is there any other (than Analytics) reliable (and free) stats solution you could suggest? One that would actually check if people have JS enabled?

Statcounter seems to have what you need: http://www.statcounter.com/features/#javascript-stats

Here is a list with a few others: http://www.hongkiat.com/blog/top-14-free-web-statistics-tools/

like image 185
Paul Avatar answered Oct 12 '22 22:10

Paul


This method has few drawbacks, since it doesn't recognise google's robot (or any other)

So, in theory it is possible that all those 32% of visits were done by bots?

I'd say it's a huge drawback.

You should try removing bots from the equation and see how it looks then.

like image 33
Rene Saarsoo Avatar answered Oct 12 '22 20:10

Rene Saarsoo