Google Analytics Event Tracking and Variable visibility.
Posted
by Jeow
on Stack Overflow
See other posts from Stack Overflow
or by Jeow
Published on 2010-03-19T11:14:54Z
Indexed on
2010/03/21
6:41 UTC
Read the original article
Hit count: 327
google-analytics
Hi guys, I have added to my html page the standard latest snippet to get google analytics to work:
... ...
var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-15080849-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = 'http://www.google-analytics.com/ga.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga); })();
Now looking at the official 'event tracking guide' google says:
add a snippet such as: pageTracker._trackEvent('Videos', 'Play', 'Gone With the Wind');
my question is:
where is pageTracker coming from ? is it a global object in ga.js ? but if it is, why google did not tell me that they run a risk on breaking some script...
I must be missing something any help really appreciated.
© Stack Overflow or respective owner