• Adsense
  • Blogger
  • WordPress
  • Social Media
  • SEO
  • Tips
  • Offbeat
Reading: How to Add Links To Detect Adblock On Blogger Blog Using JavaScript
Share
BlogbeastBlogbeast
Aa
Search
  • Adsense
  • Blogger
  • WordPress
  • Social Media
  • SEO
  • Tips
  • Offbeat
Copyright © 2023 BlogBeast. All Rights Reserved.
adsenseblogger

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

admin By admin 08/27/2022 2 Min Read
SHARE

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.

You Might Also Like

How to make a Biolink for Instagram on Blogger

How to add a cookie consent notification to Blogger

Difference between Blogger and WordPress | Best blogging platform in 2022

How To make your blogger theme responsive

How to Add Simple Stylish Recent Posts Widget For Blogger

Share this Article
Facebook Twitter Copy Link Print
By admin
Follow:
Success is no accident. It is hard work, perseverance, learning, studying, sacrifice and most of all, love of what you are doing or learning to do.
Previous Article Essential Conditional Tags For Blogger
Next Article How to add Simple Random Post Widget For Blogger
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

235.3k Followers Like
69.1k Followers Follow
56.4k Followers Follow
136k Subscribers Subscribe

Latest News

What is blogging and how to make money from it?
What is blogging and how to make money from it?
How To Make Money from Blogging
8 Fastest ways on How To Make Money from Blogging
What is wordpress plugin
20 Best WordPress Plugins for your Websites in 2022
How to Uninstall Wordpress Plugins manually
How to Uninstall WordPress Plugins completely with Shortcode

You Might Also Like

How to make a BioLink for Instagram in Blogger
blogger

How to make a Biolink for Instagram on Blogger

4 Min Read
bloggerwidgets

How to add a cookie consent notification to Blogger

4 Min Read
bloggerwordpress

Difference between Blogger and WordPress | Best blogging platform in 2022

9 Min Read
bloggertips

How To make your blogger theme responsive

4 Min Read

Always Stay Up to Date

Follow our Facebook to get our newest articles instantly!

We provide tips, tricks, and advice for improving websites and doing better search.

Quick Links

  • About
  • Disclaimer
  • Privacy Policy
  • Write for us

Resouce

  • About
  • Disclaimer
  • Privacy Policy
  • Write for us

Get the Top 10 in Search!

Looking for a trustworthy service to optimize the company website?
Request a Quote

Removed from reading list

Undo
Welcome Back!

Sign in to your account

Lost your password?