0
votes

I am trying to setup event tracking in Google Analytics and events do not seem to be sent.

Somewhere in my javascript after page load:

ga('send', 'event', 'someCategory', 'someAction', {
    hitCallback: function() {
        console.log('Tracking is successful');
    }
});

I have tried with both analytics.js and analytics_debug.js, with and without the hitCallback. This is following with Google documentation about events tracking in analytics. None requests anything:

analytics_debug.js gives some extra logs:

Running command: ga("require", "eventTracker")
    Waiting on require of "eventTracker" to be fulfilled.

And nothing seems ever to be fulfilled.

I have tried to include also this snippet in some sick try of voodoo debugging.

ga('require', 'eventTracker');

Edit:

Following @Eike I found remaining autotrack code like:

ga('require', 'eventTracker');

Removing it fixed the problem.

1
Can you show your full code (including the bit that creates the tracker) ? eventTracker sounds like a part of the autotrack.js plugin. Wild guess would be that the plugin is called on tracker creation, but the plugin file is not included in the code (at least that would produce a similar error). - Eike Pierstorff
I have updated my question, basically I found the problem while looking for the information you requested. Thanks a lot! - AsTeR

1 Answers

0
votes

Check if the script Google Aahas a function ga ('send', 'pageview'); If not, you need to add