如何判断网络客户端是否阻止广告?
记录访问我的网站并将其浏览器设置为阻止广告的访问者数量的统计数据的最佳方法是什么?
What is the best way to record statistics on the number of visitors visiting my site that have set their browser to block ads?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您需要考虑屏蔽广告的不同方式。 首先要查看的是它们是否正在运行 noscript,因此您可以添加一个脚本来检查这一点。
接下来就是看看他们是否挡住了闪光灯,一部小电影应该可以做到这一点。
如果您查看 adblock 站点,就会发现一些迹象表明它是如何阻止的:
元素隐藏是如何工作的?
如果您进一步查看该页面,您将看到传统的 chrome探测不起作用,因此您需要尝试解析更改后的 DOM。
You need to think about the different ways that ads are blocked. The first thing to look at is whether they are running noscript, so you could add a script that would check for that.
The next thing is to see if they are blocking flash, a small movie should do that.
If you look at the adblock site, there is some indication of how it does blocking:
How does element hiding work?
If you look further down that page, you will see that conventional chrome probing will not work, so you need to try and parse the altered DOM.
将用户 ID 添加到广告请求中:
这样您就可以检查哪些用户看到了哪些广告。
Add the user id to the request for the ad:
that way you can check what ads are seen by which users.
由于像 AdBlock 这样的程序实际上从不请求广告,因此您必须查看服务器日志以查看同一用户是否访问了网页但没有访问广告。 这是假设广告位于同一服务器上。
如果您的广告位于单独的服务器上,那么我建议不可能这样做。
阻止用户拦截广告的最佳方法是使用由服务器生成并显示在 html 中的内嵌文本广告。
Since programs like AdBlock actually never request the advert, you would have to look the server logs to see if the same user accessed a webpage but didn't access an advert. This is assuming the advert is on the same server.
If your adverts are on a separate server, then I would suggest it's impossible to do so.
The best way to stop users from blocking adverts, is to have inline text adverts which are generated by the server and dished up inside your html.
我想您可以将广告印刷品与网站上的页面浏览量(可以从分析软件获得)进行比较。
I suppose you could compare the ad prints with the page views on your website (which you can get from your analytics software).
AdBlock 论坛这样说用于检测AdBlock。 经过一些调整后,您可以使用它来收集一些统计数据。
AdBlock forum says this is used to detect AdBlock. After some tweaking you could use this to gather some statistics.