Digital Marketing

A guide to understanding blocked ad 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 leaves you guessing.

  • Are my ads not loading correctly?
  • Are my ads underperforming?
  • How many of my visitors never see them?
  • Who is blocking my ads?

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

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

Discovery of ad blocker data

Ad blockers are definitely not as invisible as you would like to think. Of course, that’s not really his main goal anyway. We’ll tell you, step by step, how to copy and paste a small snippet of JavaScript code to better understand your ad blocking traffic.

We will give you detailed setup instructions. We’ll also explain how to understand your new Google Analytics data. So what is the end result?

  • You will know what percentage of your visitors use ad blockers
  • You will be able to determine the impact it has on your advertising revenue.

Its a big problem. Ad blocking cost publishers an estimated $22 billion during 2015. Usage grew 41% worldwide in the last year. Drink.

First Things First: Your Prerequisites

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

We use them as the key elements of the detection hack, which by the way is courtesy of the great contributors at Webmaster World. They detect when AdSense is not running as expected, indicating that an ad blocker has been implemented. That means ads from any network are likely to be blocked as well. All your ads are gone…just like that.

FYI: For the purposes of our strategy, we are ignoring users who disable JavaScript entirely. This is a very small segment of your traffic. And they are very difficult to track. They are likely to be very tech-savvy users who are willing to accept a degraded presentation across the web.

Here is the TL;DR

You need this JavaScript snippet:

ga('enviar', 'evento', 'AdSense', 'Anuncios no bloqueados', { "nonInteraction": 1 });

}

}

}, falso);

}

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

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

  1. Create a custom segment
  2. Create new segment for “Blocked ads”
  3. Set up a new segment to capture 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 ad blocker tracking code

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

Paste the code snippet just before the tag end of your site template. It has to appear on every page. That’s all you need for the installation part of the code.

Note: For this trick to work, your Google Analytics must be Universal Analytics or the version containing “analytics.js”.

What does the JavaScript code do?

This is not a coding tutorial, so we won’t bore you with more technical complexity than necessary. It’s just some really clever JavaScript. This is what is happening step by step:

  1. Wait for the page to load, and then check if Google Analytics loaded successfully.
  2. If GA loaded JavaScript then it is working so check if your Google AdSense loaded too.
  3. Send some data to your Google Analytics account to indicate if the ad was blocked or not.

If your pages load and your Google Analytics is doing what it’s supposed to, check your AdSense.

What if AdSense doesn’t load? So we can reasonably infer that an ad blocker prevented it from loading. arrested!

That’s it. Clever code that uses clever logic to segment users who block ads and those who don’t. It then sends this information to Google Analytics for review.

A single line of code tells Google Analytics to store an event for us. That event tells us if we detected the blocked ad or not. That’s it.

There are also additional features for advanced users, but that’s for another article.

Leave a Reply

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