| Welcome to WebmasterWorld Guest from 184.108.40.206 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
|Event Tracking (GA) Stopped Working After Site Redesign|
| 11:57 pm on Jul 19, 2014 (gmt 0)|
So I just noticed that my event tracking stopped working about the same time I redesigned my site.
I am pretty sure that I am missing a line of code (or two) in the google analytics script.
but there are SO MANY DIFFERENT versions of the GA script (universal / ga.js / asynchronus ) that I am not certain which line(s) of code to add.
I am tracking clicks on internal links (pretty sure the code that is in the href tag is fine.
Here is my script:
var _gaq = _gaq || ;
ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
var s = document.getElementsByTagName('script'); s.parentNode.insertBefore(ga, s);
This is what a link looks like (I have exemplified the category, action and label):
|<a onclick="_gaq.push(['_trackEvent', 'CategoryName', 'ActionName', 'LabelName']);" href="http://www.example.com/"><img src="http://www.example.com/images/123.jpg" border="0" width="90"><br> |
thanks in advance for letting me know what I am missing.
NOTE: I should mention that I am tracking demographics, too, so maybe that is causing a problem? (Or that is what is causing the code to look a bid different?
| 7:45 pm on Jul 21, 2014 (gmt 0)|
I'm not an expert but I don't see anything missing. I believe the first block of code must be before the second block (your links).
| 9:28 pm on Jul 21, 2014 (gmt 0)|
Thanks for taking a look, bumpski:
I think I found the error and it was basically a brain cramp on my part. I just was looking at the wrong place for event tracking.
I probably need to go our and freebase some Centrum Silver...
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved