I'd like to get some statistics on how many people coming to my site have set their browser to block ads. Any tips on the best way to do this?

+2  A: 

I suppose you could compare the ad prints with the page views on your website (which you can get from your analytics software).

+8  A: 

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.

+6  A: 

Add the user id to the request for the ad:

<img src="./ads/viagra.jpg?{user.id}"/>

that way you can check what ads are seen by which users.

Jon Works
+3  A: 

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: http://adblockplus.org/en/faq_internal#elemhide

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.

+3  A: 

AdBlock forum says this is used to detect AdBlock. After some tweaking you could use this to gather some statistics.

<script language="JavaScript" type="text/JavaScript">

setTimeout('detect_abp()', 10000);
var isFF = (navigator.userAgent.indexOf("Firefox") > -1) ? true : false;
var hasABP = false;

function detect_abp()

if(Components.interfaces.nsIAdblockPlus != undefined)
hasABP = true;
var AbpImage = document.createElement("IMG");
AbpImage.id = 'abp_detector';
AbpImage.src = '/textlink-ads.jpg';
AbpImage.style.width = '0px';
AbpImage.style.height = '0px';
AbpImage.style.top = '-1000px';
AbpImage.style.left = '-1000px';
hasABP = (document.getElementById('abp_detector').style.display == 'none');

var e = document.getElementsByTagName("iframe");
for (var i = 0; i < e.length; i++)
if(e[i].clientHeight == 0)
hasABP = true;
if(hasABP == true)
location = "http://www.tweaktown.com/supportus.html";
Michal Sznajder