0

I had this tracking code on some of my links for some time, but now don't see any results. So I'm wondering if the Google Analytics syntax changed at some point?

<a alt="reviews" href="http://example.com/services/site-reviews/" onClick="ga('send', 'event', { eventCategory: 'Home', eventAction: 'site review'});">Site Reviews</a>

Or perhaps there is something wrong with the code that I'm not seeing? Secondary eyes would be very helpful here.

Thanks

WPMonkey
  • 91
  • 7
  • 1
    No, the syntax hasn't changed. Could the page be unloading just as the event is being sent (and therefore preventing GA from receiving the hit)? If so, then you could us a hitcallback, as outlined here http://stackoverflow.com/questions/32691924/how-to-wait-until-tracking-scripts-have-fired-before-redirecting-the-user. – nyuen Jun 06 '16 at 23:16
  • You could try and amend your configuration object with the transport option, namely transport: 'beacon', which in modern browsers should fire even if the page unloads (alas not on IE) as the user navigates away. – Eike Pierstorff Jun 07 '16 at 14:40

0 Answers0