Marc Uberstein
Marc Uberstein

Reputation: 12541

Google Analytics _trackEvent issue

I have added event tracking to my site, I am receiving a 200 response and everything looks in a working conditions. I am using the following method I coded :

function track(event, action) {
        _gaq.push(['_trackEvent', 'Website Name and Section', event, action]);
    }

And binding it come click event to call the method passing through values like this :

track("Facebook Share", "click");

BUT on Google Analytics only display the amount of events logged (21,549), but not showing up in the break down??? See the screenshot below:

enter image description here

Please let me know what I can do to fix this issue... coz it clearly logs it, but not displaying it and making it available to view the event info.

Upvotes: 2

Views: 2351

Answers (1)

Marc Uberstein
Marc Uberstein

Reputation: 12541

I fixed it by making sure the latest GA Script was used, grabbing it from the Google Analytics console, and adding it before the closing </head> tag.

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'XX-XXXXXXX-X']); //Place correct account id
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

And my existing tracking event code worked 100%!

function track(event, action) {
        _gaq.push(['_trackEvent', 'Website Name and Section', event, action]);
    }

Usage :

track("Facebook Share", "click");

Upvotes: 1

Related Questions