Today, most of the users are using adblock softwares like Adblock Plus and Ghostery to remove ads from websites.
But, most of the bloggers are dependent on Adsense or other advertisement networks to pay their hosting and maintenance bills.
Due to increasing number of Adblock users, The publishers’ revenue is decreasing continuously. If the situation will not be solved, it’s sure the death of free blogs is very near.
How to Enable Ads for Adblock Users
So, Here we’re trying to bypass Adblock technology to enable ads for Adblock users with simple & lightweight script.
How Adblock kill Ads
Adblock is a simple extension which has given URLs and codes of some popular advertisement networks.
So, whenever it finds that URL or code in the webpage, it removes that code or block the URL. It hides the advertisement from the user to give better experience to readers.
Some web giants like Google are paying huge money to adblock developers to not block their ads directly.
But, normal bloggers can never afford it. So, adblock is creating better environment for internet users, but It’s the biggest pain point for Bloggers.
There are various options available in market to detect adblock users, and stop them from visiting your blog. with Popup or other type of Redirection.
But, these methods can affect a lot in SEO and create bad impression on users.
So, Many bloggers started donation or premium plan for their Readers. But it’s not possible for every blogger to go to affiliation model.
So, We tried to develop a simple script to bypass adblock technology by showing alternative content to adblock users.
We are also using the same technique for better monetization. You can open this page with and without Adblock to understand what we are trying to do.
How this Adblock Bypass Script Works
The simple concept is if the user is using adblock, we will show alternative content to the user.
And if the user is not using adblock, we will show Adsense or other type of banner ad. For adblock users, we can use content like affiliate banner ad, Facebook like box, Youtube video, Search box or some other message.
Here, the script waits for 5 seconds after the page load request and checks If the ad is visible or not.
If the ad is not there, the script simply inject the banner or any other code at location of ad unit. If the ad is visible, then the script will do nothing. So, only one ad will be visible to non-adblock users also.
Copy Script……
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script> <div id="unit1"> <!-- Your Default Ad Code Here --> </div> <script> $(this).delay(5000).queue(function() { if(unit1.clientHeight == 0) { document.getElementById("unit1").innerHTML = "<!-- Your Alternative Ad Code Here -->"; } $(this).dequeue(); }); </script>
Now, put your default ad code and alternative ad code ( for adblock users ) in the above script. And put this code in place of your default ad code. That’s all..
For each ad unit, change the “Unit1” with different values ( Unit2, Unit3 ) in highlighted lines.
Here is the example with adsense code and Facebook Like box for better understanding.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script> <div id="unit1"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3152670624293746" data-ad-slot="9051963577" data-adtest = "on" data-ad-format="rectangle"></ins> <script>(adsbygoogle = window.adsbygoogle || []).push({});</script> </div> <script> $(this).delay(5000).queue(function() { if(unit1.clientHeight == 0) { document.getElementById("unit1").innerHTML = "<iframe src='//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fblogbing&width=292&colorscheme=light&show_faces=true&border_color&stream=false&header=true&height=250' scrolling='no' frameborder='0' style='border:none; overflow:hidden; width:292px; height:590px;' allowTransparency='true'></iframe>"; } $(this).dequeue(); }); </script>
The best way to use this script is with Affiliation Banner Ads. But, again it depends on your blog topic and how you want to monetize.
If you have any other better tools, want to add something or need any help, comment here.