Diego Scataglini

Looking Ahead

Google Analytics setDomain beware

August17

In May I added a google analytic line of code that should be used when tracking users among different subdomain under the same profile. The call in question is setDomain. I went through the documented steps (http://code.google.com/apis/analytics/docs/tracking/gaTrackingSite.html#domainSubDomains) and pushed it to production. I have used this functionality successfully previously.

About a month later I realized that line of code was completely screwing up with my analytic reporting. Was was happening is that google would view a portion of my traffic, if not all, as if, whenever they’d click on a link on the site, the user would leave the site and then come back on the page that they actually navigated to. This pretty much made every single page on the site a landing and an exit page.

This inflated a bunch of data, bounce ratio went up to 98% for most pages, unique visits & % new visitors were inflated and the page per visit went down accordingly. The only traffic that was tracked correctly was the ajax call that I was tracking. Since there was no change in url they didn’t count as exit/re-entry.

I looked through the GA googlegroups posting and apparently I wasn’t the only one having this problem.

The shocking part to me is that nobody from google posted a reply. I tried a bunch of possible remedies in vain.

So just as a buyer beware post, if you’re using this directive make sure it works, check your bounce ratio for the next 2 days.

As you can see from my graphic below it’s pretty obvious the effects of this seemingly innocuous function call.

Inflated reporting as a result of setDomain

Inflated reporting as a result of setDomain

Use at your own risk, really.

posted under Web | No Comments »