urchinTracker() is not defined

I tried to use Google Analytics for the first time and encountered an error message I’ve seen before.

Firebug would report: urchinTracker() is not defined.

I just could not understand why I would get this error message.

Turns out to be simpler than I imagined.

  1. I was blocking urchin.js at googleanalytics.com using AdBlock (so for all of you people who blindly trust their results, they’re awfully skewed),
  2. the provided JavaScript from Google does not properly check if the urchinTracker() function is indeed defined prior to calling it. Suppose you have it blocked through AdBlock the urchin.js file won’t load, next you try to call the function, which isn’t declared in the namespace and thus triggers an error in the Firebug debugger.

One way around this was to use the code from http://www.buayacorp.com/archivos/google-analytics-urchintracker-is-not-defined/ and the problem should go away. It seems that the suggestion in this thread over at Google groups has already been incorporated with the current urchin.js file.

Leave a Reply

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