Google Analytics tracking javascript code

Google Analytics have released a NEW version of their tracking javascript code (ga.js) so create the following two javascript files:

googanala.js
var gaJsHost = ( ("https:" == document.location.protocol) ? "https://ssl." : "http://www." ) ;

document.write(
                unescape(
                        "%3C" +
                        "script type='text/javascript' " + "src='" + gaJsHost + "google-analytics.com/ga.js' " +
                        "%3E" +

"%3C" +
                        "/script" +
                        "%3E"
                )
        );

googanalb.js
var pageTracker = _gat._getTracker("UA-999999-9");
pageTracker._initData();
pageTracker._trackPageview();

and include the following two lines in your footer

script type="text/javascript" src="googanala.js" /script
script type="text/javascript" src="googanalb.js" /script

with angle brackets added back in !

Read and post comments | Send to a friend