Detecting AdBlocking software?

James P. Wright picture James P. Wright · Jul 26, 2009 · Viewed 12.5k times · Source

I was recently visiting a site and noticed that the page had a section that said it noticed that I was using AdBlocking software and could I kindly turn it off to help support a small site like that. I was just wondering how you would do that? Would it be best done client-side or server-side?

Answer

Jasper picture Jasper · Jul 26, 2009

This is something that simply can't be done server side - there's zilch reason for person to knock on your door and say "Look at me, I have AdblockPlus!". When on the client side, adblock is actively trying to influence the page content, which is something you can see happen and see that they are using an adblocker.

Anyway, I happened to know that newgrounds.com is doing this too. (their new layout was screwed up for adblock plus users - as a response they made a contest for the best "if you're not going to help us through our ads, go and buy something in the store"-banner.

A quick look in the source of newgrounds told me they are doing this with some simple javascript. First in the document:

var user_is_leecher = true;

Next there is a external script tag: src=checkabp?thisistotrickabp=***adress of ad affilliate***

Now the joke: they simply trust adblock plus to filter that script out, as all that's in there is: user_is_leecher = false;

From there, they can do just about anything.