I implemented pretty much standard examples:
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-mycode']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<script>
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>
and links have this onclick event:
<a id="latestDownload" href="https://example.com" onClick="recordOutboundLink(this, 'newDownloads', 'latest');return false;">Download latest version</a>
Over the past 3 days, events have not been tracked, which sounds wrong. I tested the page with the GA debugging plugin for chrome, which shows that events are being sent.
Did I make any mistake here?
Edit:
Page:
refreshless.com/nouislider/download/
Edit 2:
The Google GA debugging addon shows (literally, not obfuscated):
Account ID : UA-XXXXX-X
&utmac=UA-XXXXX-X
Do I need to press "_setAccount" again?
source
share