A Guide to Understanding Ad Blocked Traffic in Google Analytics

A Guide to Understanding Ad Blocked Traffic in Google Analytics

Ad Blocker software doesn’t care about your terms and conditions, or how hard you work to create your content. In the process of blocking your ads, it messes up your Google Analytics tracking – and it leaves you guessing.

  • Are my ads not loading properly?

  • Are my ads underperforming?

  • How many of my visitors never actually see them?

  • Who’s blocking my ads?

Just to make things clear, we’ll say it again, we’re not going to tell you how to do anything illegal. In fact, we’re just going to utilize a smart code strategy. It’s one that gives us a way to detect when ad blockers are being used. Let’s ask Mr. Doyle why that’s important:

“It is a capital mistake to theorize before one has data” – Arthur Conan Doyle

Uncloaking the Ad Blocker Data

Ad Blockers are definitely not as invisible as they might like to think. Of course, that’s not really their primary goal anyway. We’ll tell you, step by step, how to copy-paste a little piece of JavaScript code to better understand your ad blocking traffic.

We’re going to give you detailed configuration instructions. We’ll also explain how to understand your new Google Analytics data. So what’s the end result?

  • You’ll know what percentage of your visitors are using ad blockers

  • You’ll be able to determine the impact it has on your Ad revenue

It’s kind of a big deal. Ad blocking cost publishers an estimated $22 billion during 2015. Usage grew by 41% worldwide in the last year. Gulp.

First Things First – Your Prerequisites

To use this strategy, your site must have both Google Analytics and Google AdSense installed.

We use these as the key elements of the detection hack, which by the way is by courtesy of the great contributors at Webmaster World. They detect when AdSense isn’t running as expected, which indicates that an ad blocker is in place. So that means ads from any network are most likely getting blocked too. All of your ads are gone… just like that.

FYI – For the purposes of our strategy, we’re ignoring users who are disabling JavaScript entirely. This is a very small segment of your traffic. And they are very hard to track. They are likely highly techie/experienced users who are willing to accept a degraded presentation across the entire web.

Here’s the TL;DR

You need this JavaScript snippet:

if(typeof adsbygoogle!== "undefined")

window.addEventListener('load', function()

if(typeof ga!== "undefined")

if(typeof adsbygoogle.loaded === "undefined")

ga('send', 'event', 'AdSense', 'Ads blocked', "nonInteraction": 1 );


ga('send', 'event', 'AdSense', 'Ads not blocked', "nonInteraction": 1 );

, false);

If you want to track only “Ads blocked” events, you can use this modified version:

if(typeof adsbygoogle!== "undefined")

window.addEventListener('load', function()

if(typeof adsbygoogle.loaded === "undefined" && typeof ga!== "undefined")

ga('send', 'event', 'AdSense', 'Ads blocked', "nonInteraction": 1 );

, false);

Now that you’ve pasted the above, let’s go over to Google Analytics and get down to business:

  1. Create a Custom Segment

  2. Create New Segment for “Ads blocked”

  3. Configure new segment to grab data for the event created in the above JavaScript.

  4. Repeat for “Ads not blocked”

  5. Extra credit: Create a custom dimension

How to install the ad blocker tracking code

If you’ve installed snippets of code on your site before, you’re good to go. If not, we really recommend you add a tag management system like Google Tag Manager. Otherwise, please contact your friendly neighborhood web developer for a quick code update.

Paste the code snippet just before the ending

No comments