While checking your website’s stats you may have thought that, although my site has a good traffic but my ad revenue very low, why so?? Then you might have tried all the different positioning, color and format of ads to make them more attractive.
Actually the main problem is ,even you make changes to your ad formats to make it more visible and attractive, majority of the visitors do not want to see them. Most of the regular Internet users uses ad-blockers. Especially in case of FireFox, people use an add-on named – Ad-block plus [Even I am using it :p ].
Ad Blocker gets both positive and negative reactions.Majority of people love it, as it blocks all those unwanted ads .On the other hand the webmasters hate this add-on as it disables the source of income for ad supported websites.
Let’s see what we can do to block/redirect these vis….itors.
While searching for blocking scripts I came across two nice solutions
Both of them work very nicely but they are a bit complicated and only work with Adblock Plus on firefox.
Hence I worked out a very simple JavaScript which redirect these kinds of visitors to some other webpage. This script uses code form Adblock Detection Script .
This script checks whether adsense ads were displayed on that page or not. If not, then it redirects the visitor to another page.You can create a warning page for such visitors but what I will recommend you to create a special “lite” version of your website for such visitors and ask them to disable their adblocker to browse the whole website.Please keep in mind blocking visitors means you may see a declination in your traffic but you may earn more revenue as you will make them disable their adblocker.
Here is the code of the script
<script type="text/javascript">setTimeout('check_ads()', 100); function check_ads() { var rnd = Math.random(); if (rnd < 1) { // only execute the following if rnd < .2 var blocked = false; var e = document.getElementsByTagName("iframe"); for (var i = 0; i < e.length; i++) if ((e[i].src.indexOf("googlesyndication.com") > -1) && (e[i].setAttribute && (e[i].style.visibility == "hidden" || e[i].style.display == "none"))) blocked = true; if ((e.length == 0) || blocked) { location = "http://www.YOURWEBSITE.COM/warningpage.html"; //enter the url of the page which contain the message for the //blocked visitors.Alternatively you can create a lite website //for them and ask them to disable their blocker who browse the //full website. window.location(location); }}}</script> If you are unable to see the whole code : Download the text file from here
To use this script simple copy paste the code blow, just above your </body> tag OR your Adsense ad code.
A working demo is available here
(Please disable your adblocker before continuing else you will directly land on the warning page).
The issues with this script are:
- If the visitor use their browsers back button from the warning page then the script fails.
- Only works with Adsense because it only checks the access of googlesyndication.com from the webpage. Although you can replace it for other advertisers
- I have no idea whether Adsense allows these kinds of scripts or not.
Please do comment on this script.





Nice post, thank you.
You wrote: “What I think is visitors using these kind of add-ons just use up the bandwidth :-/.”
I think this is a very narrow point of view. Visitors with these kind of add-ons also tend to be the more technically inclined and they probably have a blog of their own, use twitter and a host of other such things. If they like your website, they’ll use all those channels to promote you and bring you a lot more of the non-ad-blocking junta.
Thanks for your comment “Sids”.
You are correct.
That’s why I mentioned “….. blocking visitors means you may see a declination in your traffic…).And that’s the reason why I am not using this script on my websites.
You mentioned
Just wondering how that’s possible :-s
What I meant to say was “visitors using adblockers use up the website’s resources and in return the webmaster doesn’t get anything”
I know it sounds very mean and selfish but its the truth
.
..I think I should remove that line..Everyone is bashing me for writing that line
Heheh, actually it IS true
But regardless, the point I wanted to mention is that, there will be a drop in traffic, whats worse is that some of your loyal readers would start boycotting the site, something which isn’t too pleasing, is it!
It will certainly affect your readership.
All seems a bit pointless to me. For a start visitors using an adblocker are never going to click on your ads anyway. The redirect and warning page will be a huge “turn-off” for many visitors like me (same as pop-ups, if a site uses them I immediately abandon it whether it is relevant to my search or not; I HATE them!)And, isn’t the redirect (and possible return!) going to use up even more bandwidth unless it is to a completely separate site?
Though this script is good, but it is not good idea to redirect your visitors, Even i am also using adblocker plus
Doesn’t work if the end-user also uses No-Script.
@Subbu LOL
I see there are a lot of comments from people who say using a script like this will make traffic drop off. Which is exactly what many of us want if it is traffic which doesn’t view advertisements.
If you don’t want to view ads, then don’t visit web sites that have ads. My bet is you won’t have many sites on the internet to go to at all.
If you’re not willing to support sites you like by viewing ads, why do you visit the sites? No one is *demanding* that you visit their site. If a majority of people started using noscript and adblockers web sites would drop like flies and your internet searches would come up much emptier if not empty. My bet is even iamsumeet.com will go offline if advertising revenue dries up.
Sumeet ur a genious!
Im using it for cpalead.com though.
but unfortunate to say, when I use it, its driving everyone to the warning page for some reason.
Can you please tell me, if im doing anything wrong? You probably already helped enough with this amazing piece of code, but its no use to me if it drives all the traffic to the warning page lol
Regards
Riz
There is not a good way to do this. Javascript is just so easily blocked, meta redirects inside elements are useless (noscript plugin includes the meta redirect block inside those). Even that CPALead POS is bypassable. You can’t stop me!