Bill Zimmerman
Bill Zimmerman

Reputation: 21

Google Analytics Event Tracking not working?

I've added the following code to my web app, so that when a user clicks on a button, a google tracking event should be recorded:

//links jquery to button
$(this).click(function() {

    //toggles a window on the screen here....

    //GOOGLE tracking code
    //keep track of what the user clicks on
    _gaq.push(['_trackEvent', 'libraryWidget', 'togglesLibrary']); (breakpoint stops here)
});

The problem is, absolutely no events are showing up on my analytics page (page views work fine). I've placed a breakpoint in the code and google chrome does successfully break here. I looked at the console for error messages but nothing shows up. I am using the asynchronous analytics tracker.

Could this be because my analytics code is included at the end of my web page? The jquery code is setup when the page loads, additionally the callback won't be called until the user presses the button.

Can anyone provide some next steps? How can I begin to debug this problem? If I had an error message of some kind I could do something...

Upvotes: 2

Views: 1265

Answers (1)

Zayar
Zayar

Reputation: 347

I faced this kind of problem too in my localhost, I uploaded to test server which can access from internet, its working.

Another possible thing is Event tracking is not updating dynamically, it will take some times to reflect in your Analytics account

Upvotes: 2

Related Questions