How To Install Anti Adblock Script In Blogger And WordPress?

 

How To Install Anti Adblock Script In Blog


Introduction

Many of us offer free content to users on our blogs, but the way we earn money is by providing ads for various products and services on our sites. If you want to keep your ads from being blocked by anti-adblock programs, you'll need to install an anti adblock script in either Blogger or WordPress. Anti adblock scripts are relatively easy to use and will not affect your site negatively. They do require some code tweaking, however, so if this scares you, use these instructions before getting started:

What is Anti AdBlock Script in Blogger:

What is an anti adblock script? This is a script that prevents the adblockers from blocking your ads. There are many adblockers that are used to block ads, so this script is used to prevent your ads from being blocked.

What does it do? The anti adblocker will identify if the visitor has an active ad blocker installed on their browser and then serve them a different version of the site than everyone else. The difference here is that instead of showing them blank pages or hidden content, they'll see something like "Thanks for giving us some attention!"

Anti Adblock Script For Blogger:

Anti AdBlock Script For Blogger:

Adblock is a popular browser extension for blocking advertisements. If you’re using it, and have no intention of switching over to an ad-supported model, then you may want to take steps to prevent your readers from getting around it by using anti adblock scripts like the one below. The script will help you detect if an adblocker plugin is being used on their computer or mobile device and stop them from viewing your content unless they disable their adblocker.

Installing Anti AdBlock Script in Blogger:

To install the anti adblock script, you need to find your blog body tag. If you don't know where it is or what it does, that's fine! I'll explain it later in this guide.

Once you've found your tag, look for a blank line above the closing body tag. On that line enter this code:


<style type='text/css'> /* Anti Adblock script */ @keyframes fadeInDown{0%{opacity:0;transform:translateY(-20px)}100%{opacity:1;transform:translateY(0)}} @keyframes rubberBand{from{transform:scale3d(1,1,1)}30%{transform:scale3d(1.25,0.75,1)}40%{transform:scale3d(0.75,1.25,1)}50%{transform:scale3d(1.15,0.85,1)}65%{transform:scale3d(.95,1.05,1)}75%{transform:scale3d(1.05,.95,1)}to{transform:scale3d(1,1,1)}} /* Anti Adblock script*/ #arlinablock{background:rgba(0,0,0,0.65);position:fixed;margin:auto;left:0;right:0;top:0;bottom:0;overflow:auto;z-index:999999;animation:fadeInDown 1s} #arlinablock .header{margin:0 0 15px 0} #arlinablock .inner{background:#e3482d;color:#fff;box-shadow:0 5px 20px rgba(0,0,0,0.1);text-align:center;width:600px;padding:40px;border-radius:5px;margin:7% auto 2% auto;animation:rubberBand 1s} #arlinablock button{padding:10px 20px;border:0;background:rgba(0,0,0,0.15);color:#fff;margin:20px 5px;cursor:pointer;transition:all .3s} #arlinablock button:hover{background:rgba(0,0,0,0.35);color:#fff;outline:none} #arlinablock button.active,#arlinablock button:hover.active{background:#fff;color:#222;outline:none} #arlinablock .fixblock{background:#fff;text-align:left;color:#000;padding:20px;height:250px;overflow:auto;line-height:30px} #arlinablock .fixblock div{display:none} #arlinablock .fixblock div.active{display:block} #arlinablock ol{margin-left:20px} @media(max-width:768px){#arlinablock .inner{width:calc(100% - 20px);margin:10px auto;padding:15px}} </style> <script type='text/javascript'> //<![CDATA[ // Anti Adblock script  function downloadJSAtOnload(){var e=document.createElement("script");e.src="https://cdn.jsdelivr.net/gh/Arlina-Design/​quasar@master​/arlinablock.js",document.body.appendChild(e)}window.addEventListener?window.addEventListener("load",downloadJSAtOnload,!1):window.attachEvent?window.attachEvent("onload",downloadJSAtOnload):window.onload=downloadJSAtOnload; //]]> </script> 


Step 1. Find your blog's body tag

This step is very important. If you don't know how to find your blog's body tag, then this guide will be useless for you.

You need to find the body tag of your website and then use the find-and-replace tool on it.

Step 2. Enter the following code just before the closing body tag

After you have copied the code, you will need to open your website's HTML and paste it in. You can find this code by clicking on “Layout” and then “Page Elements” at the top right of your blogger dashboard. Once you are in Page Elements, click on “Edit HTML/CSS” and paste the code there. The same process works for WordPress users; just access the template editor by going to Appearance > Editor > Theme Options > Header Code – make sure that 'show_adminbar' is set to false (this will not work if you enable this option).

Now that we have made our changes, let's see how long they take effect!

Step 3. Save your template and you're done!

Now you're all set! You can either go to your blog and see if it worked, or save the template and play around with it. If it doesn't work, try again. If it still doesn't work, try a different script.

Your ad code may not work without this script

In case you are wondering why your ad code may not be working, it is because of the anti-adblock script. This script is a simple code that allows you to show ads on your blog.

If you want to install this script on your blog so that it can start showing ads and earning revenue for you, then keep reading as we will tell you how to do so in this article.

Conclusion

In our example, some ad networks offer a better revenue model than others. We have found that Ezoic is the best and most profitable ad network for bloggers. It’s easy to set up, and it supports all types of ads, including AdSense. The best part is they pay you 51% more than other networks such as Google Adsense!

Post a Comment

Previous Post Next Post