How to Track Ad blockers on Google Analytics: A Handy Guide

2018-02-16T13:52:51

With the increasing use of ad blockers these days, it’s important for online publishers to determine how (and to what extent) their website is affected.

This is a crucial step because you need to decide the next course of action based on your findings. If most of your visitors use ad blockers and your ad revenues are taking a dip, you should find an alternative revenue model for your site.

While you can simply install one of those anti-ad blocking plugins on your site, it might slow down your site and affect the user experience as well. The point is why use anti-ad blocking plugin without even knowing if your visitors are using one to begin with?

In this guide, I will share with you an easy way to set up a custom dimension, create a new segment and custom report in your Google Analytics to determine the approximate number of site visitors using ad blockers.

Step #1: Add Javascript Code to Your Site’s Header
Step #2: Set up a Custom Dimension in Google Analytics
Step #3: Create an Advanced Segment
Step #4: Create a Custom Report for users with Ad Blockers

How Does it Work?

We’re essentially going to create a code snippet which will create an HTML element named “AdSense”. Then we add the code snippet to the header section of our website. If a visitor to the site has some kind of Ad Blocker enabled on their browser, the HTML element will not be visible. Moreover, we will create a new segment to categorize those visitors separately to give your a fair idea about the volume of traffic that are unable to see your Google AdSense ads.

Note: In order to create and install this code, you need to have admin privilege of the site as well as Google Analytics.

Add Tracking Code to Your Site

The following javascript is designed to capture the visitors who have a ad blocker installed and enabled on their browser.

Copy and paste the following code snippet to the header section of your website.

https://gist.github.com/topleague/7f6c9c86f951962b2a3d994bcafd8691

Don’t forget to replace UA-XXXXX-Y with your Analytics ID.

Click save when you’re done.

Setup Custom Dimension in Google Analytics

A custom dimension essentially helps you record additional data in Google Analytics. The standard dimensions such as source, medium, city, browser give you an diverse insights about your visitors and their behaviours. For our purpose, we will create a custom dimension, i.e, Blocked Ads so we can compare the data for future actions.

Even as the above code snippet captures the data related to ad blockers, it will not reflect on Google Analytics on its own. For that to happen, we need to set up a custom dimension and an Advanced Segment for Blocked Ads in Google Analytics.

Follow the steps below to setup a custom dimension in Google Analytics:

Create a New Segment in Google Analytics

Note: If you have limited access and are prohibited from searching, you can also scroll to the Custom Dimensions category and choose from there.

That’s it! You’re done configuring your advanced segment

Give it a week or so and you should be able to see the data

Create a Custom Report for users with Ad Blockers

If you want to create a custom report, e.g, All users vs Ads Blocked, simply create a custom report in the following way:

Here’s what a custom report looks like.

Track Ad blockers on Google Analytics

That’s it!

I hope you find this guide useful. If you have any questions, leave a comment below.