By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
BlogbeastBlogbeast
  • Adsense
  • Blogger
  • WordPress
  • Social Media
  • SEO
  • Tips
  • Offbeat
BlogbeastBlogbeast
Search
  • Adsense
  • Blogger
  • WordPress
  • Social Media
  • SEO
  • Tips
  • Offbeat
© 2025 Blogbeast. All rights reserved.
AdsenseBlogger

How to Add Links To Detect Adblock On Blogger Blog Using JavaScript

Last updated: 27/08/2022 6:02 PM
By admin

How to Add Links to Detect Adblock with JavaScript – If you want to know whether visitors on your blog blocking Google AdSense ads or not, you can do so by adding a JavaScript code.

This JavaScript automatically detects if any of your site visitor using an Adblock extension enabled browser, Then it brings a special message to your blog visitor. This JavaScript code supports the new format of the data Asynchronous Responsive Google Adsense ads.

The code is also quite light, so you do not have to worry if the code is going to weigh on the loading speed of your blog. For those who want to try please follow these steps:

Login to Blogger> Open Template Editor> Then add the following code before </ body>

<script type='text/javascript'>
//<![CDATA[
// Adblock Detected
window.onload=function(){setTimeout(function(){var e=document.querySelector("ins.adsbygoogle");e&&0==e.innerHTML.replace(/s/g,"").length&&(e.style.cssText="color:rgba(0,0,0,0.5);font-weight:700;font-size:110%;padding:20px;margin:auto;text-align:center;text-decoration:none;display:block!important;background:rgba(0,0,0,0.02);border:1px solid rgba(0,0,0,0.08)",e.innerHTML="It seems that you block Google AdSense ads on your browser")},2e3)};
//]]>
</script>

There are two highlighted codes, one is the CSS of the Displaying message and the second one is the displaying message. You can modify these two codes according to your taste.

Save your template, then check your blog after enabling an Adblock extension to your browser and ensure that the code is going well.

Read More

How to write a post on blogger – Blogging tutorials for beginners
How To Setup Custom Robots Header Tags In Blogger 2022
How To Create a Material Design Dialog Box On Blogspot Blogger
How to add Simple Random Post Widget For Blogger
How To Report Adsense Invalid Clicks To Adsense Team
Share This Article
Facebook Email Print
YoutubeSubscribe

Popular Posts

What is blogging and how to make money from it?
Offbeat

What is blogging and how to make money from it?

How To Make Money from Blogging
Monetization

8 Fastest ways on How To Make Money from Blogging

What is wordpress plugin
Wordpress

20 Best WordPress Plugins for your Websites in 2022

How to Uninstall Wordpress Plugins manually
Wordpress

How to Uninstall WordPress Plugins completely with Shortcode

What is wordpress plugin
Wordpress

What is wordpress plugin ? How to install WordPress plugin in 4 easy methods?

You Might Also Like

BloggerTutorials

Essential Conditional Tags For Blogger

By admin
01/02/2022
BloggerSEO

How to add Blog/Website to Google Search Console to increase blog/website traffic

By admin
17/09/2019
BloggerWidgets

How to add Facebook Page like box on your blog – Blogger tips for beginners

By admin
17/09/2019
Blogger

How to Install Responsive Sitemap with Labels in Static Page on Blogspot Blogger

By admin
18/08/2019
AdsenseMonetization

7 Things To Be Avoided To Keep Google Adsense Safe

By admin
01/02/2022
BloggerTutorials

Create Privacy Policy Page For Blog To Get Google Adsense Approval

By admin
01/02/2022
Blogbeast

Welcome to BlogBeast, the place where blogging meets earning,and ideas turn into something big.

Quick Links

  • About
  • Contact Us
  • Subscribe

Useful Links

  • Disclaimer
  • Privacy Policy
  • Sitemap
© 2025 Blogbeast. All rights reserved.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?