(720) 420-6030

_gat error message – Troubleshooting | Google Analytics:

“_gat not defined”

Google Analytics causes some errors (visible by seeing the ‘Done, but with errors’ type of message in lower part of Internet Explorer 7, or Firebug in Firefox.

Looks like the Google script does not validate if the actual tracking script is already loaded before it is executed.

There are several fixes and work-arounds out there, but I tried several and this is the only code that ultimately worked for me:

if (typeof(_gat) == "object") {
var pageTracker = _gat._getTracker("UA-XXXXXX-1");

Be sure to replace the “UA-XXXXXX-1” with your Google Analytics account number, and also insure the carriage return does not add any extra spaces.

Jeff Kemp (Golden, CO), jeffkemp.org.