Wednesday 18 March 2009

Ad Blocker Detection

Late last week I mentioned Adblock Plus in my list of Essential Add-on Tools for Firefox. Here's the description again, just in case you missed it:

Adblock Plus allows you to browse without ads. It works very well and is incredibly popular because of that. Users love it, advertisers and websites dependant on ad revenue hate it. As long as flash banners keep soaking up CPU cycles, I'll keep using it.
https://addons.mozilla.org/en-US/firefox/addon/1865


Just about all websites rely on advertising revenue to some degree. The problem is, how do you measure the number of potential impressions you're losing to ABP?

A couple of weeks ago I cooked up a very simple solution that seems to perform quite well. In this example I'll track it with Google Analytics, but you could easily rework it to your own system.


ABP blocks items based on a list of exception rules. This detection script relies on a javascript file specifically named to be blocked by these rules. According to this script you have ABP enabled on this page (assuming you're viewing this on something that supports javascript).

Here's the code:

<script type="text/javascript">var hasABP='ABP';</script>
<script type="text/javascript" src="/js/advertising.adserver.bannerad.js"></script>
<script type="text/javascript">pageTracker._setVar(hasABP);</script>


The contents of the file /js/advertising.adserver.bannerad.js are:

var hasABP = '';

So after running this for a few hours, you should spot ABP users as 'ABP' in the Google Analytics User Defined section. In theory you could get some false positives, but the rate reported for me was so low that I think it's performing well.

Once you have some data collected, you can set up Custom Segment in Analytics' Advanced Segments and try and estimate the lost impressions based on page views.

No comments:

Post a Comment