Resource icon

Ad Blocker Notice

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

If you are using async Adsense ads, this is an easy way to show a notice to your visitors who are using ad blockers. I've found that a lot of members are willing to whitelist if asked to do so.

Just copy the code provided on this page: http://www.labnol.org/internet/alternate-content-for-adblock/28602/

Paste that code into your footer template just prior to the final "</xen:hook>"

You can add any custom HTML message you want, but keep in mind that any image or span style will...

Read more about this resource...
 
  • Like
Reactions: rdn
Works great with Chrome but doesn't work on Adblock Plus for Firefox.

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.
 
  • Like
Reactions: rdn
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?
 
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.
 
Back
Top Bottom