I have a page that is using Google Analytics to track page views as well as track events within the page. The initial _gat._trackPageview request works as intended (under normal circumstances, details to follow). However, on subsequent utm.gif
requests, it seems there is a malformed utmcc
argument in the querystring. The campaign tracking is missing:
Malformed:
utmcc=__utma%3D198519536.1306122932.1283860172.1283860172.1283860172.1%3B
Normal:
utmcc=__utma%3D198519536.1779782135.1283862963.1283862963.1283862963.1%3B%2B__utmz%3D198519536.1283862963.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B
Looking at my cookies, __utmz
seems to be correctly formed in both cases:
198519536.1283862963.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
Now, the odd thing is that this bug seems to occur somewhere between the initial page track, and the time when the user interacts with the page; _gat._trackEvent
is affected by it.
It gets even stranger when we consider that I've tested the exact same code on another server, and it behaves correctly - the utmcc
data is maintained across page views.
Things I've considered:
- cookie conflicts - this is refuted by the test on the other server
- global variable conflicts - the GA code does not seem to expose any globals that affect the utm.gif call.
- Server configuration - I'm working under ASP.NET, and there seems to be no meaningful difference between the live server (where the problem is occurring) and the test server (where the problem is not)
- ASP.NET Script Resources conflicting - I don't know how to test for this, or what to do about it if this turns out to be the issue
- Redirects - This page does use redirects under certain circumstances, and I know there can be issues with that, but the issue seems to be occurring only when we don't redirect. Also, it seems to be occurring within the page load.
Has anybody run into this issue before? Have you encountered similar situations? Is it something I can avoid in the future?