JavaScript 检测/浏览器统计

发布于 2024-07-24 01:42:13 字数 854 浏览 7 评论 0原文

这个问题已经被问过几次了,但我认为仍然值得与你们核实以获得更多意见。

我的所有网站都使用 Google Analytics 进行统计。 由于它依赖于 JavaScript,我认为检查有多少人在其浏览器中启用/禁用了 JS 是很重要的。

我记得我经常检查 w3schools 浏览器统计数据,最近的结果显示大约 95%对我来说还是比较满意的。 但由于它纯粹适用于他们的网站,我想我应该检查一下我的网站上有什么。 我尝试了几种方法,但最近我计算了 main.js 文件的所有页面浏览量和所有下载(通过添加到文件路径的“缓存杀手”变量阻止缓存)。 这种方法有一些缺点,因为它不能识别谷歌的机器人(或任何其他),但它仍然足够准确。

令人惊讶的是,只有 68% 访问我最大网站的人启用了 JS(其他方法 - 例如使用 cookie - 我尝试显示了类似的数字)。 我很乐意被告知我的方法是完全错误的,这就是数字如此之低的原因。

由于我构建的网站不依赖 JS 工作,因此从功能角度来看这仍然没问题,但这也意味着我网站的 32% 的条目正在被 Analytics 统计! 这是一个巨大的缺点。

有没有其他网站(w3schools 除外)分享他们的统计数据? 或者我可以将我的数字进行比较的调查? 也许你们中的一些人也可以分享你的?

现在我正在考虑创建自己的统计引擎。 但是您可以建议其他(除了 Analytics 之外)可靠(且免费)的统计解决方案吗? 一个可以真正检查人们是否启用了 JS 的东西?

任何有关 JS 检测的建议也非常受欢迎。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

凶凌 2024-07-31 01:42:13

还有其他网站吗(除了
w3schools)分享他们的统计数据?

Thecounter.com 有一些统计分析:http://www.thecounter.com/stats/

这里是 包含 2009 年 3 月的 javascript 统计信息的链接

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

或者我可以比较我的数字的调查
到?

我的建议是制作自己的统计数据。 您自己的用户才是最重要的。
例如,为有可访问性问题的人构建一个网站或为移动设备构建一个网站意味着您不会期望启用 js 的情况下有太多访问。

但是还有其他的吗(除了
分析)可靠(且免费)的统计数据
你可以建议解决方案吗? 一个那个
实际上会检查人们是否有 JS
启用?

Statcounter 似乎有你需要的东西: http://www.statcounter.com/features/# javascript-stats

这是一个包含其他一些内容的列表:
http://www.hongkiat.com/blog/top -14-free-web-statistics-tools/

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/

夏尔 2024-07-31 01:42:13

此方法有一些缺点,因为它无法识别谷歌的机器人(或任何其他)

所以,从理论上讲,所有 32% 的访问有可能都是由机器人完成的吗?

我想说这是一个巨大的缺点。

您应该尝试将机器人从等式中删除,然后看看它会是什么样子。

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.

緦唸λ蓇 2024-07-31 01:42:13

测试 JS 文件是否下载并不是测试 JS 是否受支持的好方法,因为该文件可能会被下载、解析,然后不会被使用。 或者只是无法下载。

测试 JS 是否启用的一种方法是使用统计数据来计算每个页面的点击并将其添加到数据库中。 然后有一个 JS 函数,它发布到一个特殊页面,该页面使用 AJAX 将一个值附加到页面列表,告诉它 JS 正在该页面上工作。 然后你可以过滤你的数据库并查看其中有多少页面启用了 JS 或未启用。

Testing to see if a JS file downloaded or not is not a good way to test to see if JS is supported as the file could be downloaded, parsed, and then not used. Or it could just not be downloaded.

One way to test to see if JS is enabled is to have a stat counting every page hit and adding that to the database. Then have a JS function that posts to a special page that appends a value to the page listing using AJAX that tells it that JS is working on that page. Then you can filter your db and see how many of those pages have JS enabled or not.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文