Is there an easy way to find out what percentage of visitors to a webpage are not using javascript?
views:
101answers:
2
+9
A:
If you want to do it yourself try this:
<noscript><img src="countNoJS.php" style="display:none" /></noscript>
<script>document.write('<img src="countJS.php" style="display:none" />');</script>
Ghommey
2009-10-12 08:54:08
+4
A:
Most of the more modern analytic programs will do this for you but ... you can use the tag and a 1x1 gif and count the hits in the log files.
<noscript>
<img src="http://www.mysite.com/assets/images/no_javascript_1x1.gif" alt="" width="1" height="1" border="0" />
</noscript>
or for secure pages:
<noscript>
<img src="https://www.mysite.com/assets/images/no_javascript_1x1.gif" alt="no javascript marker" width="1" height="1" border="0" />
</noscript
If this was a high use image you could have an issue with proxy caching but suspect there are so few people with no javascript , this will not be an issue.
Mike
MikeyB_Leeds
2009-10-12 09:04:58
+1 for "don't reinvent the wheel"
Piskvor
2009-10-12 09:09:00
Which free modern analytic programs? I know that google analytics doesn't because it is javascript based. Is there one you have in mind?
chris
2009-10-12 10:18:17
awstats ( log parser not only Javascript based ) and Piwik ( Javascript based )
Ghommey
2009-10-13 06:44:29
You will need access to your log files. I was thinking of one of these: ** http://en.wikipedia.org/wiki/Category:Free_web_analytics_software**But all they do is something similar - make reference to an image in a noscript tag. If its a "one off" you can get a long way with your log files and grep. I have also been known to use Perl for more difficult questions or answers that I need more than once. – MikeyB_Leeds 9 mins ago
MikeyB_Leeds
2009-10-13 10:15:21