I'm cleaning up the Google Analytics tracking for a complex corporate website.
The website is spread across a bunch of subdomains (
www.example.com for the main content,
dev.example.com for developer information,
pages.example.com for legacy content, and so on) and I've found that each subdomain uses its own tracking cookie, so Analytics treats them all as separate sites (when tracking referrals, for example) even though the data all feeds into the same web property.
As Google recommends, I'm going to fix this by adding
_gaq.push(['_setDomainName', 'example.com']); to the tracking code on each subdomain, so that they all use the same tracking cookie. However, the site is very complex and several different groups maintain their own subdomains, so it's going to be difficult to coordinate the switchover.
In particular, this comment gives me pause:
Yes you have to use
wwwpages as well. Otherwise cookies might get overwritten everytime you change subdomains and data loss will occur.
So, given that:
- the bare domain (
example.com) just redirects to the
- some of the subdomains currently have the
_setDomainNamemethod explicitly set to
'none', but some don't have it set at all,
do we risk any data corruption if we stagger the tracking code update across the subdomains?