nowhere
nowhere

Reputation: 1548

Google analytics: cross domain tracking + 301 redirect

I'm right now working on multiple websites from the same company each one connected to the others with a list of links on the top header.

The visits tracking is done with Google analytics and everything seems to be working fine. Too bad that they now seem to be unhappy with all the utm* parameters which get attached at the bottom of the url to obtain cross domain tracking.

For me the best solution seems to be this: each url which links to another one of the sites is like 'www.somename.com/en' where 'en' is the desired language. After clicking the new page opens with an url like 'www.somename.com/en?_utma=xxxxxxxx&_utmb=...'

If i remove from the links the language changing the href to 'www.somename.com' when the page loads, the site makes a 301 redirect from 'www.somename.com/?_utma=xxxxxxxx&_utmb=...' to 'www.somename.com/en' where 'en' is the standard language, obtaining in this way exactly what the site owner desires.

Since i don't have access to the G anlaytics account i would like to ask if this might be the right solution or if we may be losing the cross domain tracking.

The cookie __utmz seems to contain the right referrer but I'm not sure if this can be considered enough to check if it is working.

But then i checked the other parameters here http://helpful.knobs-dials.com/index.php/Utma,_utmb,_utmz_cookies and it seems to me that all the other values on the cookies that we get after getting on the new domain don't have to be in any way related to the ones on the previous page (the site with the links).

What else should i check to be sure that everything is still working fine?

Thanks,

Upvotes: 0

Views: 2130

Answers (1)

Eike Pierstorff
Eike Pierstorff

Reputation: 32760

You will lose cross domain tracking (that is, even if you might salvage the traffic source the visitor session will be interrupted when changing the domain). One of the parameters added by the linker functions is a hash value (utmk) calculated from the various utm.. parameters. If the hash is missing or does not match the parameters cross domain tracking will be broken. You need to transfer the parameters to a javascript enabled page on the other domain so that the ga cookie can be updated - after that you can do 301 redirects at will.

If you want to avoid utm parameters you can

  • switch to universal analytics - requires a single parameter to be send; however you can't switch an GA acount to universal analytics, you would have to start from scratch (UPDATE: this is no longer true, you can and indeed should update existing properties)
  • try to get into the beta for the universal measurement protocol (which would even allow for javascript-less tracking - however you'd still need to send a single id from domain to domain)

So there is no real good solution for you. It is a lot better IMO to have some strange parameters in the url than to do a reload/redirect just to get rid of them.

Upvotes: 4

Related Questions