How to install Anti Adblock script in Blogger?

In this article I will show you How you can add Anti Adblock script on your Blogger website.

Hello Bloggers. Do you have a Adsense approved Blogger Website? But can't generate revenue? Because users use Adblocker. Than This article is definitely for you. In this article I will show How you can add an Anti Adblock code on your Blogger website.

Anti Adblock script for Blogger website

But Before we add an Anti Adblock script on our Blogger website let's learn what is Adblocker and Anti Adblocker. And users and us web owner use them.

What is Adblocker and Anti Adblocker?

Adblocker is simply a software or a browser extension which allow it's users to block annoying ads. Some website owners greedily use too much ad on their Website in hope of more revenue. But users get annoyed with ads and leave your website. Adblocker simply block all the ads you placed on your website.

And Anti Adblocker is negative to it. Anti Adblocker helps you to force your users to disable Adblocker. If any one visit your website to see any content with Adblocker enabled than they will see a notice to disable Adblock. Otherwise they won't be able to see your website content. With the help of Anti Adblocker you can force your users to disable Adblocker.

Why use Adblocker?

You may have seen some streaming or downloading website with too much ads. Where ever you click it will redirect you to an ad. It's pretty annoying. That's why to get rid of unwanted ads we use Adblocker. Some Adblocker extensions helps us to disable trackers. And clean cookies by it's self. Adguard Adblocker is one of the most used Adblocker used worldwide.

Why use Anti Adblocker script?

For every website owner showing ads is very important. If you run a Downloading website or a Blog website than serving ads is the main source of your income. If users use Adblocker than your ads will be blocked. Nowdays almost everyone use Adblocker. Which greatly effects the earning. So to get rid of this revenue issue you should use Anti Adblocker script.

How to add Anti Adblock script in Blogger?

To add an Anti Adblock script on your Blogger website follow the steps as below. But before doing that make sure to download a backup of theme.

Step 1: Login to your Blogger Dashboard and go to theme section.

Step 2: Now click on "Edit HTML" than a HTML editors will open.

Step 3: Now search for </body> tag on your theme. Copy the code below and paste it right above it.

<script>//<![CDATA[ 
!function() {function f() {var a=document.getElementById("postBody");a.innerHTML='<p class="note noteAlert blocked"><strong>Ad-Block Detected :((</strong><br><br>Sorry, We detected that you have activated Ad-Blocker.&nbsp;<br> Please Consider supporting us by disabling your Ad-Blocker,It helps us in maintaining this website.&nbsp;<br>To View the content disable adblocker and refresh the page.<br><br>Thank You !!!</p>';} var b=document.createElement("script");b.type="text/javascript";b.async=!0;b.src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js";b.onerror=function() {f();window.adblock=!0};var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(b,e)}(); 
//]]></script>

Replace The highlighted id to your Post Body section id. If you the script is working without changing id than don't edit anything.

Step 4: Now copy the CSS code below and paste it right above the JavaScript and save the Theme.

<style>
article .note{position:relative;padding:20px 30px 20px 50px;background-color:#e1f5fe;color:#01579b;font-size:.85rem;line-height:1.62em;border-radius:2px}
article .note:before{content:'\2605';position:absolute;left:18px;font-size:20px}
article .noteAlert{background-color:#ffdfdf;color:#e65151}
article .noteAlert:before{content:'\2691'}
</style>
If you are using Median UI or other Jagodesign Theme than You don't have to use above CSS code.

To get Post Body id open your website on a new tab. And click any post. Now right click on mouse and select inspect. A code viewer will open from there point your mouse cursor to the starting of your post. Now see the id name from code and copy it.

Conclusion 

I hope you have successfully installed Anti Adblock script on your Blogger website. If you face any problem regarding installation process let me know on the comment section I will try my best to answer them all. And subscribe our newsletter for regular update like this. 

Hi! Zakir Here. I am a Bangladeshi Blogger and content writer. I share Blogging related and WordPress tutorial on This website. I have shared lot's of SEO related content as well.

Post a Comment

Don't upload any spam link and words that harms others in the comment box. Please comment using your Google account or with name and urls. Use anonymous only If you are not signed in.
© ZHS ThemE. All rights reserved. Developed by Jago Desain