I noticed at work that I end up with a javascript error whenever I looked at my website. The error is "_gat is not defined". Obviously this was related to the Google Analytics code so I did a little more digging. It turns out that my work firewall/proxy is blocking access to the Google Analytics script specified:
<SCRIPT src="http://www.google-analytics.com/ga.js type=text/javascript></SCRIPT>
I confirmed this by manually connecting to the address in my browser and sure enough it was being blocked. So when the Google Analytics script attempted to proceed with the code
var pageTracker = _gat._getTracker("UA-2400138-2");
there was a problem identifying _gat. So it was time to provide a simple update to my Google Tracker extension to check and see if the _gat was defined before proceeding. The result is:
<SCRIPT type=text/javascript>
if (typeof(_gat) == "object")
{
var pageTracker = _gat._getTracker("UA-XXXXXXX-X");
pageTracker._initData();
pageTracker._trackPageview();
}
</SCRIPT>
Now that I have the new Google script in place I can avoid the script errors that are displayed... Yeah!
GoogleAnalytics-v1.3.zip (1.70 kb)
UPDATE (Aug 10th) : I have updated the code to place the Google script at the bottom of the page instead of the header. Please download the latest version.
GoogleAnalytics-v1.4.zip