Google Analytics new tracking code

As I was setting up a new site in Google Analytics today I discovered that there is now new tracking code you are supposed to use. The old code is now unsupported. Your javascript snippet should now look something like.


    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"));


    var pageTracker = _gat._getTracker("PUT_YOUR_TRACKING_ID_HERE");
    pageTracker._initData();
    pageTracker._trackPageview();

This has been a community service announcement. đŸ™‚

Leave a Reply

Your email address will not be published. Required fields are marked *