By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
Blogbeast
  • Adsense
  • Blogger
  • WordPress
  • Social Media
  • SEO
  • Tips
  • Offbeat
Search
© 2022 Foxiz News Network. Ruby Design Company. All Rights Reserved.
Reading: How to Add Links To Detect Adblock On Blogger Blog Using JavaScript
Share
Sign In
Notification Show More
Latest News
What is blogging and how to make money from it?
What is blogging and how to make money from it?
Offbeat
How To Make Money from Blogging
8 Fastest ways on How To Make Money from Blogging
monetization
What is wordpress plugin
20 Best WordPress Plugins for your Websites in 2022
wordpress
How to Uninstall Wordpress Plugins manually
How to Uninstall WordPress Plugins completely with Shortcode
wordpress
What is wordpress plugin
What is wordpress plugin ? How to install WordPress plugin in 4 easy methods?
wordpress
Aa
Blogbeast
Aa
  • Adsense
  • Blogger
  • WordPress
  • Social Media
  • SEO
  • Tips
  • Offbeat
Search
  • Adsense
  • Blogger
  • WordPress
  • Social Media
  • SEO
  • Tips
  • Offbeat
Have an existing account? Sign In
Follow US
© 2022 Foxiz News Network. Ruby Design Company. All Rights Reserved.
adsenseblogger

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

admin
Last updated: 2022/08/27 at 6:02 PM
admin
Share
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

Share this Article
Facebook Twitter Copy Link Print
Share
Posted 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 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
- Advertisement -
Ad imageAd image

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

We influence 20 million users and is the number one business and technology news network on the planet

Follow US

© 2023 BlogBeast. All Rights Reserved.

Removed from reading list

Undo
Welcome Back!

Sign in to your account

Lost your password?