1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Jaxel's Implementation of Ad Block Detection

How to detect if a user is using ad-block and warn them...

  1. Jaxel

    Jaxel Well-Known Member

    Jaxel submitted a new resource:

    Jaxel's Implementation of Ad Block Detection - How to detect if a user is using ad-block and warn them...

    Read more about this resource...
    bcercan likes this.
  2. The Forum Heroes

    The Forum Heroes Well-Known Member

    Could you make it also they can't see posts if a ad blocker is detected?
  3. Jaxel

    Jaxel Well-Known Member

    You could very easily do that with adding CSS... but I wouldn't recommend it. Just ends up infuriating users.
    BamaStangGuy likes this.
  4. HWS

    HWS Well-Known Member

    We do the same at our site (however with a slightly different code) and implemented a counter to see how many % of our users use ad blockers. It is app. 30% who use that.

    We now change the code to allow guests with ad blockers to see only 5 pages before they are forced to switch off the ad blocker or register.
    The Forum Heroes likes this.
  5. The Forum Heroes

    The Forum Heroes Well-Known Member

    Could you share this?
  6. Stuart Wright

    Stuart Wright Well-Known Member

    Interested to hear what value you put on paid membership to turn ads off. Some people on our forum were saying they'd happily pay £5 a year to switch off ads. Yeah, right.
    And the problem I have with paid membership is that they will complain to the CC company/Paypal if we then ban them for any reason.
    The adblock people told me that they would not try to circumvent our adblock detection if we only used it to present a polite request to turn ads off. Otherwise they work to defeat you. And we limit access to some features to people who adblock.
    The problem with publishing this solution it is that the more people who use it, the more the adblock people will see it and be motivated to work a way round it.
  7. akia

    akia Well-Known Member

    Not if everyone changes it a little, if its a copy paste job then there will be a footprint but if you change the class names and text etc then it would be difficult to block.
    Digital Doctor likes this.
  8. Jaxel

    Jaxel Well-Known Member

    Exactly. In fact, the class names I posted in the guide are not the class names I use on my site.
  9. JordanH

    JordanH Well-Known Member

    So I tried to impletment on the xenforo forum and the ad gets like this:
  10. thumped

    thumped Well-Known Member

    seeing something similar; looks like the JS always returns 0 from my ad code- I'm using an agencies adtech.de invocation code, not adsense though.
    Last edited: Aug 5, 2013
  11. JordanH

    JordanH Well-Known Member

    I'm using something like Buy Sell Ads
  12. akia

    akia Well-Known Member

    @Jaxel whats been the response rate with this. Have you had more people sign up for premium membership. Is it actually worth doing?
  13. Jaxel

    Jaxel Well-Known Member

    I'll tell you in a week after my advert numbers come up. I don't expect more premium memberships, just more adserves.

    The problem is my community is actually pretty technically savy; and I have EXTREMELY high rates of adblock. As well, lots of people also use things like Firebug and I wouldn't be surprised if many of them create custom CSS rules to hide the adblock notice container. I know many of them use custom CSS rules to make the website black.
    milkywayz likes this.
  14. JordanH

    JordanH Well-Known Member

    Great you answered him. Care to answer the other two?
  15. Mike Fara

    Mike Fara Member

    If Jaxel's mod doesn't work you can always destroy adblockers with fire using some crazy code out there. The problem is that people who use ad block would normally never use the site if they were not allowed to use ad block... well at least thats their argument. I almost had a mutiny on my hands when I introduced similar programming, except mine locked the screen and demanded you turn it off.. lol. Well, I suppose people just don't understand this stuff doesn't run itself for free.
  16. Jaxel

    Jaxel Well-Known Member

    Thats because what you are doing is bad.

    With the adblock detection I use here, I am not hindering a user's experience with my website. Its just a big notification that they must overlook. The purpose of the notice isn't to stop or hinder the user, its to make them feel like a ****ty person. If you ruin the experience for the end user, they will just work to stop you.
  17. Mike Fara

    Mike Fara Member

    I think that is a fair trade off. Question @Jaxel are you familiar with the embedded

    <style>#za43{position:fixed!important;position:absolute;top:0;top:expression((t=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)+"px");left:0;width:100%;height:100%;background-color:#fff;opacity:0.9;filter:alpha(opacity=90);display:block}#za43 p{opacity:1;filter:none;font:bold 16px Verdana,Arial,sans-serif;text-align:center;margin:20% 0}#za43 p a,#za43 p i{font-size:12px}#za43 ~ *{display:none}</style><noscript><span id=za43><p>Please enable JavaScript!<br>Bitte aktiviere JavaScript!<br>S'il vous pla&icirc;t activer JavaScript!<br>Por favor,activa el JavaScript!<br><a href="http://antiblock.org/">antiblock.org</a></p></span></noscript><script>(function(w,u){var d=w.document,z=typeof u;function za43(){function c(c,i){var e=d.createElement('span'),b=d.body,s=b.style,l=b.childNodes.length;if(typeof i!=z){e.setAttribute('id',i);s.margin=s.padding=0;s.height='100%';l=Math.floor(Math.random()*l)+1}e.innerHTML=c;b.insertBefore(e,b.childNodes[l-1])}function g(i,t){return !t?d.getElementById(i):d.getElementsByTagName(t)};function f(v){if(!g('za43')){c('<p>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><a href="http://antiblock.org/?d=2.3'+'___'+escape(v)+'">antiblock.org</a> <i>v2.3</i></p>','za43')}};(function(){var a=['adsense'],l=a.length,i,s='',e;for(i=0;i<l;i++){if(!g(a[i])){s+='<a id="'+a[i]+'"></a>'}}c(s);l=a.length;setTimeout(function(){for(i=0;i<l;i++){e=g(a[i]);if(e.offsetParent==null||(w.getComputedStyle?d.defaultView.getComputedStyle(e,null).getPropertyValue('display'):e.currentStyle.display)=='none'){return f('#'+a[i])}}},250)}());(function(){var o={'http://pagead2.googlesyndication.com/pagead/show_ads.js':'google_ad_client'},S=g(0,'script'),l=S.length-1,n,r,i,v,s;d.write=null;for(i=l;i>=0;--i){s=S[i];if(typeof o[s.src]!=z){n=d.createElement('script');n.type='text/javascript';n.src=s.src;v=o[s.src];w[v]=u;r=S[0];n.onload=n.onreadystatechange=function(){if(typeof w[v]==z&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){n.onload=n.onreadystatechange=null;r.parentNode.removeChild(n);w[v]=null}};r.parentNode.insertBefore(n,r);setTimeout(function(){if(w[v]===u){f(n.src)}},2000);break}}}())}if(d.addEventListener){w.addEventListener('load',za43,false)}else{w.attachEvent('onload',za43)}})(window);</script>
    I ask because when I go to your site I still see ads and no notice with Adblock in Chrome. So perhaps you have found a way to simply render the ads without the notice? That is the crazy code I was experimenting with by the way. It does work from antiblock.org but it is quite stringent.
    nttruong likes this.
  18. milkywayz

    milkywayz Member

    Agreed, if someone doesn't want to view ads and is bent on that, shoving the ads down their throat forcibly wont work.
  19. Liam W

    Liam W Well-Known Member

    Anyhow, this is easily circumvented by just using the adblock addon to block the div with the adblock notice, which most people with adblock will probably do...

    Anyhow, good piece of code, thanks for sharing :)
  20. Jaxel

    Jaxel Well-Known Member

    So I saw on an XF nulled website (I occasionally do vanity searches on Google to see who is pirating my software), that a user is claiming using this code got his website banned from Google Adsense. Does anyone know if using such a code violates Adsense terms and conditions?

    As far as I know, it is only against terms to request users to CLICK on ads, not to disable ad-blockers.
    Liam W likes this.

Share This Page