Measuring the impact of adblocking with Google Analytics and GTM

adblock extension for Google Chrome and FirefoxLately, there has been a lot of talk about adblocking and its impact on digital marketing campaigns. Most digital pundits will blame adblocking for everything that is wrong with online ad campaigns – very often with no idea of what they’re talking about. In this post, I describe a method to measure said impact without having to rely on preconceived ideas or resort to guesstimates. Of course, this is done with Google Analytics and Google Tag Manager, which, ironically, are also the target of adblocking plugins – but we’ll get into that later.

Interested? See you after the jump!

Adblocking: what is it and how does it work?

Before we go in too deep, let’s start with a quick primer on what adblocking is and how it works.

Ablocking (or ad blocking) is a method whereby an Internet user installs a plugin/extension to effectively block ads from being displayed on a web page or a mobile app.

This can be done by either blocking communications with the adserving servers at the network level or by preventing the browser from executing the Javascript code required to generate and display the banner ad.adblocking no ads here please

On browsers such as Firefox or Chrome, many adblocking plugins exist. There are also quite a few options on mobile devices, just check your iOS or Google app stores.

To save you a little time, the most popular adblocking plugin is Ad Block Plus (ABP) which is free.

There is a side discussion to be had where ad companies (Google, Facebook leading the charge) are paying adblocker developers to whitelist their ad networks and allow them to not be fitered and show ads. But that’s a discussion for another time – I can’t handle that much hypocrisy in one sitting and neither should you 😉

Why are my Google Adsense checks getting smaller?

Either way, these plugins/apps are making huge chunks of web page real estate disappear, especially those that used to show ads that monetized traffic to the site. The visual impact can range from blank sections on a page to sections getting clumped together without the ad content as a buffer/filler element.

adblocking - impact on page layout

For sites that display ads, the financial impact can be substantial as less ad revenue flows in. For large media sites that depend on ad revenue to compensate their editorial staff, this can spell disaster.

Cool, I’m spending less on ads! Oh, wait.

For advertisers, however, adblocking poses a different problem. Since adblocking blocks the displaying/rendering of an ad, said ad will not be displayed (paging Captain Obvious). This means that ads that should have been displayed on the usual ad space now need to be displayed somewhere else. The issue switches from cost/ROI to ad inventory and display eligibility.

Of course, this means less money spent on ads but for niche audience for instances, if a sizeable chunk of your target audience uses adblocking, you cannot throw more money at Google or Facebook to display more ads, since your audience is finite/limited. In this particular case, adblocking can help you spend less but ads will reach a much smaller audience than intended.
Adblocking - blocking ads on youtube

So how do I make sure my ads are seen?

The obvious alternative is to detect adblocking through Javascript by tricking the adblocker plugin into thinking there is a reason to block content (a “decoy ad” if you will). We’re going to be using a similar method in this post by the way.

Detecting adblocking can then prompt the site to display a message to the effect of “Oh noes, you’re using an adblocker and we need these ads to support our staff and families. Please remove your adblocker to continue viewing our awesome content (which we’re providing for free by the way.”

Other alternatives include switching to full sponsored content, which are nothing more than glorified informercials but I think we can agree this is hard to implement and will not garner visitor/readership adoption.

So how badly is my website impacted?

To answer this, we’re going to need the help of Google Analytics and Google Tag Manager. Before you ask, everything I am describing here is applied to my own website so you can fiddle with View Source to glean additional tips on how to set this up.

First of all, I’m going to need to setup a adblock honeypot to trick the adblocking plugin into thinking my site is showing ads:

[code lang=”html”]<!–Adblock Check–>
<script src="/js/ads.js" type="text/javascript"></script>
<script type="text/javascript">// <![CDATA[
jQuery(document).ready(checkAds());
function checkAds() {
if (document.getElementById(‘adsense’) != undefined) {
document.write("<script>dataLayer.push({‘event’:’adBlock’,’blocked’:’false’});</sc" + "ript>");
} else {
document.write("<script>dataLayer.push({‘event’:’adBlock’,’blocked’:’true’});</sc" + "ript>");
}
}
// ]]></script>
<!–End Adblock Check–>[/code]

The ads.js script can be found here.

Notice how the checkAds function pushes a ‘adBlock’ event for GTM to capture? 😉 Let’s set it up to tie everything together!

First go to GTM, open your container and create a new variable called Adblocked that points to the variable you are pushing to GTM’s datalayer.

adblocking google tag manager variable

Next, let’s create a trigger that will make use of that trigger, where the value of Adblocker is either true or false.

adblocking google tag manager trigger

Finally, let’s create the tag that will capture adblock status in a Google Analytics event. Use an event and use event category, action and label to store adblock status. I use the following pattern:

  • Category: Adblock
  • Action: Blocked
  • Label: true or false

Notice that I am also setting up the event as non-interactive so as not to mess with my bounce rate.

adblocking google tag manager analytics universal event tag

Save your container and publish it and voilà! Every time your page containing the snippet I posted above is triggered, Google Analytics will register an event detailing adblocker status.

I can now go to my Universal Analytics reports and check out the extent of the damage:

adblocking report in google analytics

In this case, I went to my Events reports in Behavior > Events > Top Events and then selected Event Category “Adblock”. Then I used the Secondary Dimension dropdown to select Event Label to end up with a 2-line report showing me the share of visitors that use adblocked – or not. Finally, I clicked the pie chart icon to the right to show data as a pie chart, with an easy-to-read percentage. In the screenshot above, just south of 24% of my audience uses adblocking which is OK because I don’t rely on ads to make a living – I’m just happy if they help me pay for website hosting 😉

What now?

Well, as you can see from the screenshot, my own personal blog is very likely going to have a very specific audience so of course your mileage may vary.

My recommendation is to use Google Analytics’ alerting system to send you e-mail when the share of adblocking visitors reaches a certain threshold (25% or higher for instance) so that you can start panicking and/or take action by blocking content for visitors that do not play fair.

A more social approach is to make content available for adblockers if they share your content on social media.

Finally, this whole cat/mouse game brings us back to the early days of the printed press where sponsors helped support the cost of printing by inserting ads in the pages. The cost of creating content while minimizing exposure to ads remains an unresolved issue. My take on this is that ads are a necessary evil and we should play ball in order to gorge ourselves on kitten videos on YouTube or brilliant journalism pieces on news sites.

In the end, if there is no money to pay for content, there is no content. Don’t be a freeloading douchebag: if you know how to recognize ads, just ignore them and don’t resort to using an adblocker. Please, think of the kittens.

Comments? Feedback? Let me know in the comments! 😉

Thanks to Julien D for inspiring me to write this piece!

Author: Julien Coquet

Julien Coquet is a veteran of digital analytics, with 20+ years of experience in al things data, web and app. He is currently Senior Director of Data, EMEA @ Monks.

2 thoughts on “Measuring the impact of adblocking with Google Analytics and GTM”

  1. Hi I am amaised this method of detection is returning relevant data. As all ad blockers I install also disable the JS of Google Analytics. I would also check how many “physical” page views your server reports vs. how many views a specific page (e.g. Start Page) received. The difference between those two numbers should be the privacy causous ad blocker. The tracking issue is the main reason I don’t consider disabling ad blocking. As I am focused on blocking tracking. And as a positive addon most ads disappear as well. I typically only see self hosted ads.

  2. Thanks a lot Julien for this solution. I am wondering if you know any method by which I can identify which all 3rd party tags on my site are blocked by Adblocker. Can you please help?

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.