Block The Visitors on Your Site Who Are Using Ad-Blockers

While checking your website’s stats you may have thought that, although my site has a good traffic but my ad revenue very low, why so?? Then you might have tried all the different positioning, color and format of ads to make them more attractive.

Actually the main problem is ,even you make changes to your ad formats to make it more visible and attractive, majority of the visitors are do not want to see them. Most of the regular Internet users use ad-blockers. Especially in case of FireFox, people use an add-on named – Ad-block plus [Even I am using it :p ].

Ad Blocker gets all type of reactions. Majority of people love it as it blocks all those unwanted ads .On the other hand the webmasters hate this add-on as it disables the source of income for ad supported websites.

Let’s see what all we can do to block/redirect these visitors.
While searching for such scripts I came across two nice solutions

Both of them work very nicely but they are a bit complicated and only work with Adblock Plus on firefox.

Hence I and my friend on codingforums.com worked out a very simple JavaScript which redirect these kinds of visitors to some other webpage. This script uses code form Adblock Detection Script .

This script checks whether adsense ads were displayed on that page or not. If not, then it redirects the visitor to another page.You can create a warning page for such visitors but what I will recommend you to create a special lite version of your website for such visitors and ask them to disable their adblocker to browse the whole website.Please keep in mind blocking visitors means you may see a declination in your traffic but you may earn more revenue as you will make them disable their adblocker.

Here is the code of the script

<script type="text/javascript">
setTimeout('check_ads()', 100);      function check_ads()      {      var rnd = Math.random();      if (rnd < 1)      { // only execute the following if rnd < .2      var blocked = false;      var e = document.getElementsByTagName("iframe");      for (var i = 0; i < e.length; i++)      if ((e[i].src.indexOf("googlesyndication.com") > -1) &&      (e[i].setAttribute && (e[i].style.visibility == "hidden" ||      e[i].style.display == "none"))) blocked = true;      if ((e.length == 0) || blocked)      {       location = "http://www.YOURWEBSITE.COM/warningpage.html"; //enter the url of the page which contain the message for the//blocked visitors.Alternatively you can create a lite website//for them and ask them to disable their blocker who browse the//full website.      window.location(location);    }}}
</script>

To use this script simple copy paste the code blow, just above your </body> tag OR your Adsense ad code.




One Replies:


  1. thanks for this…great trick

Leave a Reply

;;) :-/ B-) :( /:) X-(( :-O :d X-( :| :-S :-P :> 8-| :(( :) #-o 8-} ;)