homepage Welcome to WebmasterWorld Guest from 54.211.68.132
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / WebmasterWorld / Website Analytics - Tracking and Logging
Forum Library, Charter, Moderators: Receptional & mademetop

Website Analytics - Tracking and Logging Forum

    
Event Tracking (GA) Stopped Working After Site Redesign
Planet13




msg:4689196
 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:

<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-abcdefg-h']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

</script>


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>
Text Here</a>


~~~~~

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?

 

bumpski




msg:4689571
 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).

Planet13




msg:4689599
 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...

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Website Analytics - Tracking and Logging
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved