Inspired? No home

How to track traffic from lesser known search engines with Google Analytics

Google Analytics will track traffic from search engines including which specific keywords the visitor searched for. Google handles most well known search engines but by default Google Analytics does not handle the two local search engines here in Norway, Kvasir and Sesam. It is quite easy to "hack" the GA javascript code so it will track them:

uacct = "UA-XXXXXX-X";
uOsr.push("kvasir"); uOkw.push("searchExpr");
uOsr.push("sesam"); uOkw.push("q");

Basically all you need to add is line #2 and #3. The first and the last line you will already have included in your pages.

GA has two arrays which it uses for tracking search engines:
uOsr which holds the search engine domain name and uOkw which holds the search keyword in the querystring. So by adding a new entry in the array you can add local or lesser known search engines so you can track these in Google Analytics.

By default GA tracks the following search engines:

uOsr[0]="google"; uOkw[0]="q";
uOsr[1]="yahoo"; uOkw[1]="p";
uOsr[2]="msn"; uOkw[2]="q";
uOsr[3]="aol"; uOkw[3]="query";
uOsr[4]="aol"; uOkw[4]="encquery";
uOsr[5]="lycos"; uOkw[5]="query";
uOsr[6]="ask"; uOkw[6]="q";
uOsr[7]="altavista"; uOkw[7]="q";
uOsr[8]="netscape"; uOkw[8]="query";
uOsr[9]="cnn"; uOkw[9]="query";
uOsr[10]="looksmart"; uOkw[10]="qt";
uOsr[11]="about"; uOkw[11]="terms";
uOsr[12]="mamma"; uOkw[12]="query";
uOsr[13]="alltheweb"; uOkw[13]="q";
uOsr[14]="gigablast"; uOkw[14]="q";
uOsr[15]="voila"; uOkw[15]="rdata";
uOsr[16]="virgilio"; uOkw[16]="qs";
uOsr[17]="live"; uOkw[17]="q";
uOsr[18]="baidu"; uOkw[18]="wd";
uOsr[19]="alice"; uOkw[19]="qs";
uOsr[20]="yandex"; uOkw[20]="text";
uOsr[21]="najdi"; uOkw[21]="q";
uOsr[22]="aol"; uOkw[22]="q";
uOsr[23]="club-internet"; uOkw[23]="q";
uOsr[24]="mama"; uOkw[24]="query";
uOsr[25]="seznam"; uOkw[25]="q";
uOsr[26]="search"; uOkw[26]="q";
uOsr[27]="szukaj"; uOkw[27]="szukaj";
uOsr[28]="szukaj"; uOkw[28]="qt";
uOsr[29]="netsprint"; uOkw[29]="q";
uOsr[30]="google.interia"; uOkw[30]="q";
uOsr[31]="szukacz"; uOkw[31]="q";
uOsr[32]="yam"; uOkw[32]="k";
uOsr[33]="pchome"; _uOkw[33]="q";

See the javascript here.


Written on 12 October 2007.
blog comments powered by Disqus