Uus Google Analytics tracker
Google uuendas mõni aeg tagasi oma analüütikatarkvara trackeri koodi ja uus, koos Eesti otsingumootorite tundmisega, on selline:
<script type=”text/javascript”>
var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
document.write(unescape(“%3Cscript src='” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));
</script>
<script type=”text/javascript”>
var pageTracker = _gat._getTracker(“UA-12345-1”);
pageTracker._addOrganic(“Neti”,”query”);
pageTracker._addOrganic(“Yammy”,”q”);
pageTracker._addOrganic(“www.ee”,”query”);
pageTracker._addOrganic(“Delfi”,”q”);
pageTracker._initData();
pageTracker._trackPageview();
</script>
var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
document.write(unescape(“%3Cscript src='” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));
</script>
<script type=”text/javascript”>
var pageTracker = _gat._getTracker(“UA-12345-1”);
pageTracker._addOrganic(“Neti”,”query”);
pageTracker._addOrganic(“Yammy”,”q”);
pageTracker._addOrganic(“www.ee”,”query”);
pageTracker._addOrganic(“Delfi”,”q”);
pageTracker._initData();
pageTracker._trackPageview();
</script>
ga,js mis vahetas välja urchin.js skripti on väiksem ja kiirem. Lisaks sellele teeb ise vahet http ja https protokollidel. Lisa infot:
- Installing and Customizing the Google Analytics Tracking Code
- Tracking Code Migration Guide Switching from urchin.js to ga.js
urchin.js skripti on lubatud veel aasta või rohkemgi kasutada, kuid sellele ei tule enam uuendusi.