Mobile app version of vmapp.org
Login or Join
Michele947

: Event tracking data not showing up in Google Analytics Real Time View I haven't done a lot of event tracking before, but I had a good read of how to do it and have implemented it with Universal

@Michele947

Posted in: #AnalyticsEvents #EventTracking #GoogleAnalytics #Javascript

I haven't done a lot of event tracking before, but I had a good read of how to do it and have implemented it with Universal Analytics, and here is the code used to send to GA:

function sendEventAction(category, action, label, value, non_interaction) {

value = typeof value !== 'undefined' ? value : '';
non_interaction = typeof non_interaction !== 'undefined' ? non_interaction : true;

ga('send', {
'hitType': 'event',
'eventCategory': category,
'eventAction': action,
'eventLabel': label,
'eventValue': value,
'nonInteraction': non_interaction
}
);

}


Example call:

sendEventAction('online-application-form', 'entered-word-tm', 'Word Trademark');


Looking at the developer console it seems to send the request, but nothing appears in the real time view.

What am I doing wrong here!? I read you can set Goals, but they are optional and hence I haven't set any up.

I am also wondering how google knows what account to credit the event to? As I said above I have universal analytics setup - does it get it from that? That script I believe is below the JS code that sends the event to GA however.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Michele947

1 Comments

Sorted by latest first Latest Oldest Best

 

@Phylliss660

Site is based on WordPress and turns out it had an old plugin installed that was using the former version of Google Analytics to send events itself; as soon as I deactivated that plugin events started showing up.

The aforementioned plugin is: Analytics Reduce Bounce Rate

I also commented out this line (as suggested by @nyuen ):

value = typeof value !== 'undefined' ? value : '';


Not sure if it had any effect, but eventValue is supposed to be of integer type so setting it to blank probably wasn't helping either.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme