Skip to content

How to detect when a visitor is blocking ads

Again a draft that sat in the backlog for years.

Most simple version:
<script type="text/javascript">
var adblock = true;</script>
<script type="text/javascript" src="/js/adframe.js"></script>
<script type="text/javascript">if(adblock) {adsBlocked();}</script>

(adframe.js containing something like “adblock = false;“)
It’s not very sophisticated, and it surely won’t catch everything, but it will detect if a generic filter is in place on scripts named ad*.js and such.


AdBlock counter:

Posted in published drafts, web development.

0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Some HTML is OK

or, reply to this post via trackback.

Sorry about the CAPTCHA that requires JS. If you really don't want to enable JS and still want to comment, you can send me your comment via e-mail and I'll post it for you.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA