Tag Archive for 'campaign'

Weird Issue With Urchin Campaign Tracking

Urchin has this feature to track campaigns. One can use the utm_source, utm_medium, etc; variables to track which of the campaigns drive greater traffic to the website. There is no extra setup required. I just consolidated all the information required to decorate the campaign urls and gave the wiki link to the pms.

Our website requires one to be logged in. Being signed out, if one were to enter the url to a page which required the user to be logged in, the website redirects to the login page even before urchin can kick in and set the campaign cookies. After the login procedure we redirect the user to the same url he had entered – the one which contained the utm_source variable. So, logically speaking Urchin should be setting the right campaign values here. This is where things started to go wrong. Urchin did not set the correct cookie values!

To make things more bizzare, no matter how many times you refresh the page Urchin would just disregard the utm variables. But if the same link was to be copied and pasted into a new tab Urchin would kick into life and recognize the campaign parameters. The same url getting differential treatment! World is not fair.

The issue was killing me. That is when I checked the window.location in the browser console. And guess what I found out? The first url had encoded characters – _ converted into %5F. So the utm_source variable becomes utm%5Fsource! Obviously Urchin could not find any tracking variables in the url. I changed the code to un-escape the login redirect url and things worked like a charm.

Otherwise a simple problem, it became complicated in this case because my browsers were always showing the url to contain utm_source variables whereas the window.location was actually utm%5Fsource. I never knew that the two could differ.

Popularity: 2% [?]