Subscribe via

How to Discourage Visitors from Using AdBlock

Thaya Kareeson

How to disable AdBlockIf you are a new user and you use any form of advertisement blocking (e.g. AdBlock) on your browser, you would have been greeted with a neat little message saying “Doh! It appears that you are using AdBlock software…”.

The purpose of this post is to show you how to create such a message for your own website. I had this idea from a comment I found on one of my favorite blogs (Webmaster Source) regarding combating AdBlock.

Before I go on, let me say that I am not interested in discussing/debating the use and ethics of AdBlock software in depth in this post. I’m planning on writing a post with my research and data on the effects of discouraging AdBlock use in a later post, so let’s save that discussion for another time.   For now I would like you to evaluate the pros and cons of this mod and decide for yourself if you would like to install the mod or not.

Update 1/11/2009

I have created a WordPress plugin to do this. Just activate and go. Check it out here, Anti-AdBlock WordPress Plugin.

Pros

  • Makes your visitors aware that your website is funded by advertisements.
  • Visitors are encouraged to turn off their AdBlock software for your website.

Cons

  • The mod is written using jQuery so it will not have any effect on browsers with javascript disabled.
  • It does not guarantee that the visitor will disable AdBlock on your site.

Installation

  1. Insert the following tag into your theme.  This div block will be populated with the AdBlock message when AdBlock usage is detected. For my WordPress installation, I placed it just above my main content div block in header.php.
    <div id="content_adblock_message" style="display:none"></div>
  2. Download the following bait banner and put it into a directory called “ad” on your server. For example,

    “http://omninoggin.com/wp-content/themes/omninoggin/images/ad/banner.gif”.

  3. Refer to the “bait banner” image anywhere in your theme. Make sure your set the IMG ‘id=”banner”‘. For example:
    <img id="banner" src="/path/to/ad/banner.gif" width="1" height="1"/>
  4. Download the following onload.js javascript and place it anywhere on your server.
  5. Open onload.js to modify the message if necessary.
  6. Refer to jQuery library and onload.js, by add the following lines into your footer.
    <script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js"></script>
    <script type="text/javascript" src="/path/to/onload.js"></script>

Testing

  1. Try visiting your site with AdBlock on. You should see the AdBlock message.
  2. Disable AdBlock and refresh the page. You should not see the AdBlock message.

WordPress Plugin?

I’ve already received a request from one person that I should package this into a plugin. Would anybody else like to request this? The more number of requests makes it higher priority on my to-do list :) .

Enjoyed This Article?

You should check out other top articles on the Articles page.

Save and Share
Del.icio.us
StumbleUpon
Digg
Reddit

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Currently experiencing problems with Intense Debate commenting system. Please make sure your browser's Javascript is enabled and try again later.