How to Add Adblock Detection to Your Site for FREE with PubGuru Apollo

Ad Blocking
Last updated: September 5, 2019 | by David Loschiavo
How to Add Adblock Detection to Your Site for FREE with PubGuru Apollo

This post was most recently updated on September 5th, 2019

Adblock has become the bane of existence for many publishers.  Percentages of Adblock rates vary by site vertical and geographical location breakdowns.  Most US traffic sites are at 10-20% adblock rates.  Some verticals, especially very technical coding sites, as well as video game sites, often see 70% or higher adblock rates.

In this guide, we’re going to show you how to set up adblock detection for free with PubGuru Apollo

Analytics and Reporting

When you add this code to your page, results are stored in Google Analytics (GA) by default.  This is intentional as we want you to be able to access reporting via an interface you already use.  Note: Google is a registered trademark of Alphabet Inc. and this adblock detection technology is not endorsed by or affiliated in any way with Alphabet, Google, or their affiliates.

You can change your analytics endpoints by removing all the GA code and overriding apollo.logBlocked() and apollo.logUnblocked() to whatever you want.  Some publishers want to do this because although most adblockers do not block GA, some adblockers and some plugins do (including Ublock Origin).  These users are very rare though, so using GA provides a solid, reliable pipeline for Adblock detection with minimal additional overhead.

This is also one of the reasons why the code must be put directly on the page.  You cannot simply link to it because popular Adblock repositories have repeatedly blocked domains that we’ve hosted this code on.

Licensing

PubGuru Apollo is licensed under the MIT license.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS,” WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

If you do not agree to this licensing, do not use this code.

Implementation

Copy and paste the source of this file into any pages you want to run Adblock detection with.  You must copy that source and put it directly on your page.  If you just link to the file, it will not and cannot work.

By default, sampling is set to 1% of traffic.  This is because GA only gives a certain amount of data points per day and if you run over your quota, you’ll lose pageview data.  If you want to change the sampling, modify the line with apollo.sampling to some number between 0.1 (0.1% of traffic) and 100 (all traffic).

In setting up the script, change apollo.verbose = true; to see the output.

Reading the Data

Once the code is live on your site, you can pull up your events section.  You will find a category called “Adblock (Pubguru Apollo)” and inside that category are event counts for how much adblock has been detected (or not).  Your adblock rate is the number of events there for the “blocked” label divided by the total of both unblocked and blocked events.

More than 1500 publishers see 50-400% ad revenue growth with us.

Don't just take our word for it

$100M+

Paid to Publishers

3B+

Ad Requests Monthly

1500+

Happy Publishers

Recommended Reading

make-money-real-estate-sites
Blog
April 19, 2024

Navigating the Online Real Estate Marketplace: 8 Tips for Monetized Publishers

Read More
view-bot
Blog
April 17, 2024

ViewBotting: How Bad Bots Affect Publishers?

Read More
best-video-ad-networks
Ad Network Reviews, Tips & Guides
April 16, 2024

2024’s Best Video Ad Networks

Read More

Trusted by 1,500+ publishers worldwide

10X your ad revenue with our award-winning solutions.

Let's Talk

Close

Ready to 10X your ad revenue with the #1 ad management partner?

Start Now