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.
- Ask them to Disable their adblockers
- 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:
- Go to Blogger >> Template >>
- Back up your template incase any thing went wrong.
- Now select Edit HTML >> Proceed.
- Then search for ]]></b:skin> and once you find it, just above it paste the following CSS code.
#swp_noadblocker {
display:none;
} - 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
- Now save the template
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:
- Go To Blogger > Layout
- Click on "Add a gadget" (anywhere)
- Select "HTML/JavaScript"
- 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î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>
- Now Click Save.
Thankyou very much for visitng , if you have any question or problem regarding this post please put it in the comment box below.