Since the day AdBlocking service has been released it has become the nightmare of all content creators, which is obvious as content creator spend hours on researching things and building up great content. But the problem is not all content creators are good, some of them has no aptitude for creating good content and just have a site to make money from it. The most trusted ad publisher on the web i.e. Google Adsense doesn’t allow this kind of publishers on board with them and eventually these content creators gets frustrated and starts using disgusting ad services just to earn a few penny.

AdBlock was created to save users from those annoying ads that we all hate. Last month I did an international survey where 82% people said that they have no problem enabling AdSense ads, they just have enabled adblock service to stay away from those annoying popup ads, malware ads etc. But even if someone love your work it is very unlikely they are going to whitelist your site on adblock even if you say that you use Google Adsense. That’s because humans are a lazy being. It’s not like that they don’t wanna whitelist your site, it’s just they are too lazy to do it.

A few months back I write an article about how to show up affiliate ad banners smartly when some users have adblock enabled. But after using that for months I find out a shocking thing about human psychology. If someone has enabled adblocker on their browser that means they don’t wanna see any ads anyways. By forcefully showing affiliate ads you are not just ruining the user experience of your site, you are actually losing your trust in your user’s eyes.

So, I went back and forth with many testing to figure out what is the best way to track AdBlock enabled users behavior without ruing the user experience of my website a bit. After testing so many things I find out that the best way to track adblock enabled users is though Google Analytics. As you can gather all the information about your users depending upon their adblock status and even generate custom report to take crucial business decision too. Today I’m going to show you how you can track your adblock enabled users in WordPress using the extraordinary analytical tool i.e. Google Analytics.

The things that we need to get started

Here are a few things that you must need to have before starting the process:

  • You must need to have a self-hosted WordPress site
  • This script is only for AdSense users I do not support using any other ad publishers as they all are nothing but garbage. Just decreases user experience with annoying ads.
  • This script will only work if you are using the asynchronous version of Google Adsense code. If you are not using that, then you should upgrade now as it highly reduces page load time.
  • You must need to have Google Analytics by Yoast Plugin for WordPress (the best Google Analytics for WordPress plugin) enabled and properly authenticated to your Google Analytics account.
  • After authenticating with your analytics account go to the Analytics -> Settings from your WordPress Dashboard and click on the Universal tab.
  • Under Universal tab, mark the checkbox that says “Enable Universal Tracking” and hit save.
  • The rest of the plugin settings is up to your need, but the default settings is more than fine for most of the sites.

Enabling Custom Event Tracking

This is the part where things get a little complicated but I will try my best to keep things as easy as possible so that everyone (be it a non-techy user or pro dev) all can understand how to achieve it.

For Non-Techy Users

If you are not so techy or may be not familiar with coding, you don’t have to worry. You can still add this feature into your site. Just follow my lead. If you are using a free WordPress theme then check your theme settings whether or not it has a section to add custom javascript. Most premium theses on themeforest has this feature built in. But if you do not have that kind of functionality built into your theme, you can just simply add a WordPress plugin named Insert Headers and Footers to avail this feature. It is really a lightweight plugin, so don’t worry about the site slow down.

After installing the plugin you have to navigate through Settings -> Insert Headers and Footers and then paste the code provided below under the section named “Scripts in Footer”.

For Pro Techy Users

Well, if you are a pro user I’m assuming that you are already using a custom theme or a child theme in some way and I’m also assuming that you also have added a custom JS file for your custom theme. If you haven’t then please add a custom JS file into your theme assets folder and then in your theme’s function.php add a wp_enqueue_script call to load your custom JS file. Now within the custom JS file you just have to paste the following code to make things work. It’s that simple.

The code for Custom Tracking

Here is the code that you have to add in your website to start the AdBlock enabled users tracking process. Make sure you copy and paste it properly. Also please note as this is a free script, it doesn’t come with any warranty or support included.

jQuery(function ($) {
    /*Checking Adblock enabled and pushing it to analytics*/
    if ($(".adsbygoogle").length > 0 ){
        if (typeof(window.google_jobrunner) === "undefined") {
            __gaTracker('send', 'event', 'Adblock', 'Blocked', {'nonInteracion':1});
        } else {
            __gaTracker('send', 'event', 'Adblock', 'Unblocked', {'nonInteracion':1});
        }
    }
});

How to check these tracking results

It’s very easy to get the tracking data from your Google Analytics account. Just login to your Google Analytics account, head over to the Real Time section (on the left bar) and you will see a sub-menu called Events here. From this section, you can track your real-time users live, like how many current visitors has AdBlock enabled on their browser.

2015-10-09_20-02-23

You can also head over to the Behavior section and click on the Events section to get a long time report like month wise or year wise.

Feedback

So, what is your opinion about using AdBlock and tracking AdBlock users? Do you use any sorts of AdBlock Tracking in your site besides what I’ve showed above? Do you have any better idea of handling Adblock users without violating AdSense policy or the overall user experience? I would love to hear them in the comment section below. This post is has not ended here, we can still carry on this conversation in the comment section if you want. Feel free to subscribe to my blog for more awesome articles like this and also please don’t forget to share this post with others which might help them to save hours figuring out this by their own.

You can also connect with me via twitter @iSaumya. If you have any other ideas or request about future posts, you can let me know in the comment section below or via twitter.

Published by Saumya Majumder

Passionate, Hard Worker. Love to develop new things, Singing Songs, playing computer Action Games, tweaking with computer languages, Riding Bikes, Love long driving, love books, web & Photography. You can follow me on twitter @iSaumya

14 Comments

  1. Bah! Eta just Osasharon. 🙂
    This is something new I came upon. I will surely try it out.
    But adblock is becoming a growing trouble for us bloggers. With new people installing to get rid of “BAD/NON USER FRIENDLY” ads, is actually slashing genuine bloggers like us who are only trying to show adsense ads and earn! 🙁 Well, is there any codes to bypass adblocks and display ads even to users with adblock?

    Reply
  2. Hai
    Thanks for the jquery script. I guess yoast analytics plugin is not required. We can enable universal tracking in Google analytics. And we can add the script directly in header.php instead of creating a new file and enqueing it from functions.php

    Thanks again for wonderful script

    Reply
    • Yes, you are right yoast analytics plugin is not required you can add the code manually if you want, but the only reason I suggest people using yoast analytics is because it is easy to use and it also adds some useful custom tracking automatically, which is pretty useful. It’s a great plugin to have. Now on the next part, I will not recommend to add scripts in the head tag, its better to but in the footer before the closing of </body> tag, as it will help the browsers to render the site faster. Also about the wp_enqueue_script that is suggested for pro users because in most cases pro users either use custom made child theme or a completely custom coded themes. In any of those cases they always have a custom.js or similar file to call different jQuery stuffs for their theme, so it is always wiser to add this within the same jQuery call without creating a separate jQuery call.

      Reply
  3. I think for daily tracking this will also work.
    Total Page views by Adblock users = Total page views in google analytics – Total page views in google adsense

    Reply
  4. Hey ! Saumya Was a oshadharon Post !! Loved it! But I have a query ! I have been declined by adsense account , what should I do now. Would they give me another chance to re activate adsense. New to blogging and Dont know which kind of invalidity is causing in my blog. Please help

    Reply
  5. how to banned India envy Pak to view add units on your site in order to protect invalid activity?

    Reply
  6. Well. I am really happy to find out this important ad code. But tell me how can i emphasize on a user to unblock ad code to use my site???

    Reply
  7. Hello there, I’ve followed and implemetned everything. However, event tracking doesn’t show up. In real time I have about 130 live users but nothing is showing up under Event.

    Pls help. thanks

    Reply

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.

Subscribe To My Newsletter

Subscribe To My Newsletter

Join my mailing list to get meaningful content, useful information, how-tos, tricks, tips for webmaster, bloggers and entrepreneurs to rise and profit in your online business.

You are almost there! Just check your Inbox to confirm the Subscription & you are all set.

Shares

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close