Reputation: 1126
Hello Is it possible to check on my website if Adblock is blocking another Webpages?
I have some referal links commision but looks like visitors using adblocks and its preventing monetization. I do checking, if they use adblock on my website, but what about my partners webpages?
Is it possible to verification do on my own page? I know I can propose whitelists /filters etc. but problem still exists If my page is whitelisted but partners pages doesn't.
My idea is bellow but can be dead end or even not possible:
Using Javascript or Iframes (obsolete) or requests or any other idea?
Upvotes: 2
Views: 460
Reputation: 46
you could create a js file that allows you to intercept the presence of AdBlock Plus on the user's browser and show a message on the screen inviting him to disable it in order to view the pages correctly.
In the web page embed an external javascript file called advertisement.js.
Inside the javascript file you can insert a simple instruction to write something on the screen:
document.write('<div id="tester">an advertisement</div>');
In the Head section of the Html document of the web page, call the just created javascript file:
<script type="text/javascript" src="/advertisement.js"></script>
Create a CSS rule to inhibit the display of the #tester class from being displayed to users. In the web page insert a code to check if the class #tester is defined :
<script type="text/javascript"> if(document.getElementById("tester") !=undefined) {
document.write('');
} else {
document.write("<div style=z-index: 99; position:fixed; top:100px; background-color: #cccccc; height:400px; width:100%;>disable adblock to read this page</div> ");
}
</script>
If the #tester class is not defined, the javascript code displays a message inviting the user to disable AdBlock.
Upvotes: 2