SSL Labs ScoreSecurityHeaders.io Score

Log in to participate

There is no cost to join RicheyWeb, and membership is a requirement to submit bug reports and participate in the support forums.

× Extension Discussions

Send Ad Blocker events to Google Analytics

More
3 months 3 weeks ago #1131 by michael
michael created the topic: Send Ad Blocker events to Google Analytics
Add this code to your System - Ad...

A good way to learn if your anti-adblock messages are working is to track the adblock status in Google Analytics. This small bit of javascript will send change notifications to an already installed and enabled Google Universal Analytics.

Add this code to your System - Ad Block Reactor plugin, in a new "Change Action" item.

document.addEventListener('ABREvent',function(e){
var label = Joomla.getOptions('plg_system_adblockreactor').lastreport===null?'detected':'changed';
var value = window.adblockreactor.vars.lastreport?'enabled':'disabled';
ga('send', 'event', 'adBlocker', label, value);
},false);

You should see something like this when you're done:

After your users have a chance to react to your requests to turn off their ad blockers, you should see some data like this in Google Analytics:

Read article...

Please Log in or Create an account to join the conversation.

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to add attachements.
  • Not Allowed: to edit your message.
Kunena Forum