From here: http://www.google.com/support/analyticshelp/bin/answer.py?hl=en&answer=1136920
<script type="text/javascript">
function recordOutboundLink(link, category, action) {
try {
var myTracker=_gat._getTrackerByName();
_gaq.push(['myTracker._trackEvent', ' + category + ', ' + action + ']);
setTimeout('document.location = "' + link.href + '"', 100)
}catch(err){}
}
</script>
If you notice the + category + and + action + are in quotes. So how does the analytics script gets their values?
It's a mistake in their documentation; their code will not work as intended.
That line should read:
_gaq.push(['myTracker._trackEvent', category , action ]);
You're right. The way they have it, it has category and action passed as literal strings, rather than passing the variables that hold the strings in them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With