Google Analytics Developers, Please Update urchin.js

May 11, 2007 by reuben | Filed under Google Analytics, Tracking.

I was looking through an overall keyword conversion report in Analytics and noticed some strange search phrases appearing. They looked like long strings of random numbers and characters. It turns out that AOL must be testing some new URL structure in the search results and changed the variable that identifies the search query. I took a look at the urchin.js and noticed that the new query variable (userQuery) is not included.

The urchin.js file currently has these variables to define AOL:

_uOsr[3]="aol"; _uOkw[3]="query";
_uOsr[4]="aol"; _uOkw[4]="encquery";

To track the new AOL search queries just place these 2 lines before the urchinTracker() function in your Google Analytics tracking code:

_uOsr.push("aol");
_uOkw.push("userQuery");

Update: I replaced the manual insertion of elements into the _uOsr and _uOkw arrays with the push() function which is a much better solution.


2 Responses to “Google Analytics Developers, Please Update urchin.js”

  1. Bill M says:

    I always thought that was AOL encrypting search terms for privacy. No?

    Hi Bill

    It’s encoded if you use http://www.aol.com, but it’s in plain view when using search.aol.com. Actually, I just tried a search and they’ve reverted back to using the query= variable. Here’s two examples:

    http://www.aol.com
    http://search.aol.com/aol/search?encquery=be96de479e42554e197aece9a4974927&invocationType=aolcomsearch&ie=UTF-8

    search.aol.com
    http://search.aol.com/aol/search?invocationType=topsearchbox.webhome&query=reuben+yau

    I guess they must have changed it again, sometime around the time when Google’s Universal search was launched.

    Reuben

  2. tarmo888 says:

    you don’t need to modify urchin.js and host it on your server
    http://digg.com/programming/How_to_add_new_search_engines_to_Google_Analytics

    Hi Tarmo

    I should have gone back and edited this post, I actually now use push() to append variables to the end of the SE list. If you view source you’ll see the new code.

    Thanks

    Reuben