BlockAdBlock with Google Analytics Integration

There is a feature when you generate the code for BlockAdBlock script where you can integrate the script with Google Analytics events. This is useful to find out how many visitor of your site had ad blockers installed and met with the nagging screen or blocking screen generated by BlockAdBlock script. This is the most simplest Google Analytics event code you can use for the BlockAdBlock script.


You must have a Google Analytics account setup and the analytics script already installed in your site for tracking. The code below depends on the Google Analytics script to run.

Whenever a visitor that had an ad blocker installed and met with the nagging screen or the block screen, the script will send an event back to your Google Analytics account for logging purposes. The code below is a simple code that will send an event with category "user", event action of "AdBlock" to indicate a visitor with ad blocker installed. And then the event label with a value of "On". This logging enables you to track the trend of incoming visitors with ad blockers installed whether is there an increasing trend over the time or vice versa.

So here is the simple code:
ga('send', {hitType: 'event', eventCategory: 'User', eventAction: 'Adblock', eventLabel: 'on'});

For further customization of the code, please refer to About Events at Google Analytics Help.


Popular posts from this blog

How to recalibrate your Samsung Note 4 battery

How to import Tasker projects, profiles, tasks and scenes

How to turn your Windows 7 laptop or dekstop into a WiFi repeater or extender