Monday, March 16, 2015

How to Add Anti Adblock Script into Your Blog Guide

How to Add Anti Adblock Script into Your Blog

Adblock is the worst what happend to bloggers or website owners who work really hard to get adsense or chitika etc account and when they just start earning a bit they find out that their blog or website is getting pretty good traffic but why are not earning enough.
And the most common reason now a days is Adblockers.

What are adblockers

Adblockers are addons or plugins for browsers like google chrome,mozilla firefox etc. which is used to block ads on your blogs or websites when some one visits and has adblocker installed.
Now a days millions of people are aware of adblockers and it means those millions of people if visit your blog, you earn nothing ,not even a penny.

How to Solve this problem:

Their are actually two ways to stop people from using adblocker on your blog or website.
  1. Ask them to Disable their adblockers
  2. Force them to Disable their adblockers

Ask Them Method:

I think this method is pretty good but you should be aware of the internet punks ,and they dont care about what you say and how much hard you worked for them.
I will be suggest not to use this method if you have blog or website about downloading stuff. But if you have others then you should , its up to you.

So lets start with the method.All you need to do is follow the instructions below:
  1. Go to Blogger >> Template >>
  2.  Back up your template incase any thing went wrong.
  3. Now select Edit HTML >> Proceed.
  4. Then search for ]]></b:skin> and once you find it, just above it paste the following CSS code.
    #swp_noadblocker {
        display:none;
    }
  5. Now search for </head> and just before  it paste the following JavaScript Code. 
<script type="text/javascript">
if (document.getElementById("swp_noadblocker") != undefined)
{
}
else
{
    alert("Weve detected that youre using ADBLOCKER or some other adblocking software. In order to keep this website free, this site is sponsored in part by advertisements.
Please consider disabling your ad blocker on this website
if you enjoyed the content, and would like to support future
informative posts.Thank you!

Click OK to continue

Powered by yoursitename");
        setTimeout("nag()",12000);
}
</script>
  • Now Search for <body> and just afer  it paste the following code
.<script type="text/javascript" src="http://ftp.bauer-power.net/misc/tc/advertisement.js"></script>
  • Now save the template 
Now when an adblock user visits your site,this script will detect him and show his the message below
NOTE:In this script dont forget to change "yoursitename" with your own site name.

Force Them Method

Well what should i tell you about this method because even i use this method and it works fine.The way this script works is that when ever some adblock user enters your site or blog this script will prevent them from entering the blog and ask them to disable or close their adblock first and then they can enter.
The installation method is really easy.All you need to do is follow the steps give below:
  1. Go To Blogger > Layout
  2. Click on "Add a gadget" (anywhere)
  3. Select "HTML/JavaScript"
  4. Now paste the above given code in it.

    <style>#g207{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}#g207 p{opacity:1;filter:none;font:bold 16px Verdana,Arial,sans-serif;text-align:center;margin:20% 0}#g207 p a,#g207 p i{font-size:12px}#g207 ~ *{display:none}</style><noscript><i id=g207><p>Please enable JavaScript!<br />Bitte aktiviere JavaScript!<br />Sil vous pla&icirc;t activer JavaScript!<br />Por favor,activa el JavaScript!<br /><a href="http://antiblock.org/">antiblock.org</a></p></i></noscript><script>(function(w,u){var d=w.document,z=typeof u;function g207(){function c(c,i){var e=d.createElement(i),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(g207)){c(<p>Please disable your ad blocker!<br/>This site is supported by the advertisement <br/> Please disable your ad blocker to support us!!! </p>,g207)}};(function(){var a=[Adrectangle,PageLeaderAd,ad-column,advertising2,divAdBox,mochila-column-right-ad-300x250-1,searchAdSenseBox,ad,ads,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;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])}}}());(function(){var t=g(0,img),a=[/adaffiliate_,/adops/ad,/adsales/ad,/adsby.,/adtest.,/ajax/ads/ad,/controller/ads/ad,/pageads/ad,/weather/ads/ad,-728x90-],i;if(typeof t[0]!=z&&typeof t[0].src!=z){i=new Image();i.onload=function(){this.onload=z;this.onerror=function(){f(this.src)};this.src=t[0].src+#+a.join()};i.src=t[0].src}}());(function(){var o={http://pagead2.googlesyndication.com/pagead/show_ads.js:google_ad_client,http://js.adscale.de/getads.js:adscale_slot_id,http://get.mirando.de/mirando.js:adPlaceId},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]!==null){f(n.src)}},2000);break}}}())}if(d.addEventListener){w.addEventListener(load,g207,false)}else{w.attachEvent(onload,g207)}})(window);</script>
  1. Now Click Save.
Now any visitor having adblocker will face this message and dont able to browse you website until he turn off adblocker for your website.Here is an example how it looks.
Thankyou very much for visitng , if you have any question or problem regarding this post please put it in the comment box below.