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

Ad Blocker Notice

A very simple way to show a notice to visitors who are blocking your async Adsense ads

  1. Amin Sabet

    Amin Sabet Well-Known Member

    Amin Sabet submitted a new resource:

    Ad Blocker Notice - A very simple way to show a notice to visitors who are blocking your async Adsense ads

    Read more about this resource...
     
    RoldanLT likes this.
  2. RoldanLT

    RoldanLT Well-Known Member

    Works great with Chrome but doesn't work on Adblock Plus for Firefox.
     
  3. RoldanLT

    RoldanLT Well-Known Member

    @digitalpoint implementation works fine on Firefox though.
    Maybe you can give us advice please? :)
     
  4. Amin Sabet

    Amin Sabet Well-Known Member

    Good catch. That seems to be because Adblock Plus on Firefox automatically includes a filter called "Adblock Warning Removal List" which is designed to remove messages shown to Adblock users.
     
    RoldanLT likes this.
  5. Amin Sabet

    Amin Sabet Well-Known Member

    On my sites, less than 15% of visitors use FF, and of course not all of them block ads.
     
  6. Amin Sabet

    Amin Sabet Well-Known Member

    @RoldanLT - As it turns out, they appear to have a policy for anti-adblock messages, along with a mechanism for asking that a message which meets that policy be excluded from their filter:

    https://easylist.to/2013/05/10/anti-adblock-guide-for-site-admins.html

    I'm in the process of requesting this for my message. Will let you know how it goes!

    EDIT: I gave up after a few days and withdrew my request.
     
    Last edited: Aug 14, 2016
    RoldanLT likes this.
  7. Webby

    Webby Member

    I keep getting a 403 error when I paste this code in:

    <script>

    // Run after all the page elements have loaded
    window.onload = function(){

    // This will take care of asynchronous Google ads
    setTimeout(function() {

    // We are targeting the first banner ad of AdSense
    var ad = document.querySelector("ins.adsbygoogle");

    // If the ad contains no innerHTML, ad blockers are at work
    if (ad && ad.innerHTML.replace(/\s/g, "").length == 0) {

    // Since ad blocks hide ads using CSS too
    ad.style.cssText = 'display:block !important';

    // You can put any text, image or even IFRAME tags here
    ad.innerHTML = 'Your custom HTML messages goes here';

    }

    }, 2000); // The ad blocker check is performed 2 seconds after the page load
    };

    </script>


    should I contact my host?
     
  8. Amin Sabet

    Amin Sabet Well-Known Member

    Try pasting it instead at the end of your page_container_js_body template. If that gives the same error I would contact your host.
     
    Webby likes this.
  9. Webby

    Webby Member

    Same issue bro, thanks for the help though. I have contacted my host.
     
  10. Neutral Singh

    Neutral Singh Well-Known Member

    @Amin Sabet

    It works on Chrome flawlessly.
    Is there any script which also works in FireFox and Safari,

    Thank you
     

Share This Page