MyBB Tutorials

Prevent adblockers on your site

Submitted by Blowjob, , Thread ID: 623

Thread Closed
23-01-2015, 04:55 AM
#1
Hello webmasters,
many of you are having ads on their site and need them to get the money for domain, hosting and other stuff.

However, there are people who do ignore that and use adblockers - they use your content but you will get nothing from them.

Here is a way for you to give access to your site only, when your ads are displayed too. If somebody has an adblocker active, he will not be able to browse your site until he deactivated it.

Does work for the following advertisers:

  1. Google Adsense
  2. Adscale
  3. Bin-Layer
  4. Mirando
  5. Mirago
  6. BitVertiser
  7. AdTiger

How to do it:
Open your Admin CP, go to templates and style -> templates.

In each theme you do use, open the templates and in the "ungrouped templates"-group find the template "headerinclude".

At the end of the template put this code:

Code:
<script type="text/javascript"><!--// www.antiblock.org Anti-Adblock-Script Version 1.3001
var ab=false;var ss=document.getElementsByTagName('script');for(var i=ss.length-1;i>=0;--i){var s=ss[i].src.substr(0, 20);switch(s){
case'http://bdv.bidvertis':if(typeof(report_error)=='undefined'){ab='BidVertiser'}break;
case'http://pagead2.googl':if(typeof(gaGlobal)=='undefined'){ab='Google Adsense'}break;
case'http://js.adscale.de':if(typeof(adscale)=='undefined'){ab='Adscale'}break;
case'http://bin-layer.de/':if(typeof(blLayer)=='undefined'){ab='Bin-Layer'}break;
case'http://get.mirando.d':if(typeof(Mirando)=='undefined'){ab='Mirando'}break;
case'http://intext.mirago':if(typeof(HLSysBannerUrl)=='undefined'){ab='Mirago'}break;
}if(ab)break;}if(ab){var db=document.body;db.style.margin=0;db.style.padding=0;db.innerHTML+='<div id="ablc" style="position:absolute;top:0px;left:0px;z-index:9998;width:100%;height:1000%;background:url(\'data:image/gif;base64,R0lGODlhAQABAPcAAAAAADMzM2ZmZpmZmczMzP///5lmZmYzM8yZmZkzM8xmZswzMzMAAGYAAJkAAMwAAAAAAP8zM/9mZv+Zmf/MzP8zAMwzAP9mM8xmM5kzAP+ZZv9mAJlmM8yZZmYzAMxmAP+ZM//Mmf+ZAMyZM5lmAP/MZsyZAP/MM//MAJmZZmZmM8zM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uvPFoZyhQlSopugBMaMFbQIYRy0ROHqdDi+BocEpQhaZimZTJe0dOkKFBPEhx7TcGDk9Q2h4AmPULkCA8FKw5nebik6hG45oBAFACXiA/f6KYcCpDkihLveQ9G4xCHjI+ffBUgHWzFZVPnRihk0dtcAp58iixqdNFgjiWKiZ5QnQM9bXBo1CHWyOHDg8xI73o6VTpEjzU5QaXQi1vV5o5cSRI0xjMR6JLh7a9Q21usD3m5+7I/+FyBITGGXS0VIlkzh1qdwwAxEId750uGEOmWDgl0ZSWOFpYMU178cgTjwMAyPKeOeWcQUMRUEBgE0Mv5LGFELWUUw6B8rjiQDkGuqOhMzYMgcQNJzBEhBxqWGEGNdh0s6F78rgXjzsMYoNNKiyYKEFTBtkShB1bVJFLNdVgM6M7owDwSjwMdnNNNdQ0UcMQRUSgEAt4bGEFJFRSc0025bhTGgALaFgONlReYwsHHxhhwSgFlaHGG0VCkw2S2JBpjjmlNPCKiOVkc82h14ThwQdIQKCXQNPEcIcWW1yBBi2rZLoKK6zUUksqtXCqSiqmlErIEB98MMQNJAykxBxbaGtxBRZUBBHED7juoAMOOOTAwq/AZoBBBh900MEGRkgQSz8QOKGHG9C2IW0X1GZhrRTYPqHtE0d0W8S34BZxQwjXfEOGEUuku4QS7LKbxLvwjiDvvCOIYO+9IkxwyoSy9OvvvwAHLLC/5fQTEAA7" height="29" width="35" alt="" border="0" style="position:relative;top:6px" /> <span style="font:bold 110% Verdana, Tahoma, Helvetica, Arial">Please disable your ad blocker!<br />Bitte deaktiviere Deinen Werbeblocker!<br />Veuillez d&eacute;sactiver votre bloqueur de publicit&eacute;!<br />Por favor, desactive el bloqueador de anuncios!<br /><div align="right"><a href="http://www.antiblock.org/?ab=' + escape(document.location.href) + '&ab=' + escape(ab) + '" style="font-size:12px">www.antiblock.org</a></div></span></div>';c(80,'ablc')};function c(o,id){var s=document.getElementById(id).style;s.opacity=(o/100);s.MozOpacity=(o/100);s.KhtmlOpacity=(o/100);s.filter='alpha(opacity='+o+')'}
//--></script>

Now only users who actually see your ads and do not have an adblocker activated will be able to access your site.

The full script and further information can be found at http://www.antiblock.org/

Best regards

RE: Prevent adblockers on your site

#2
This is a great way to stop people using your website.
[Image: ZtDsXXv.png]

RE: Prevent adblockers on your site

OP
#3
23-01-2015, 06:54 AM
Unsuspicious Wrote:
This is a great way to stop people using your website.

:rly: I know. I don't use it I just shared it.

RE: Prevent adblockers on your site

#4
I added on headerinclude but not working

RE: Prevent adblockers on your site

#5
Thank you Hug, for sharing this will come in handy!

RE: Prevent adblockers on your site

#6
Good post I support advertising and disable it for donators. It's a fair way to make money when you provide a service

RE: Prevent adblockers on your site

#7
OP is banned, not working for me on 1.8.8 anyone can second this to be working?

RE: Prevent adblockers on your site

#8
Well I will try this soon. Thanks

RE: Prevent adblockers on your site

#9
Thank you sir, this is really useful information..
Does it work on last version 1.8.9? Anyone test it?

RE: Prevent adblockers on your site

#10
13-06-2015, 02:27 PM
JMPRockFm Wrote:
Thank you Hug, for sharing this will come in handy!

Users browsing this thread: 1 Guest(s)