Google Analytics, unless otherwise specified, sets its cookies at document.domain . those. he believes that www.foo.com and sub.foo.com are completely separate entities, for all purposes and purposes. While this seems strange, think about co.uk domains or services that sell services in a subdomain.
As a result, cookies set on www.foo.com are not visible when you land on sub.foo.com because they are not set in the correct domain. So Google Analytics says, βThis is a brand new visit! And they are being transmitted from www.foo.com
So there are 2 (or 3) solutions.
- (Best) Implement cross-domain tracking. Basically, ask GA to override the default domain settings. You do this using the
_setDomainName directive, which must be declared before for your _trackPageview calls for all domains and subdomains. This will solve the cross-domain tracking issue.
It looks like this:
_gaq.push(['_setDomainName', 'foo.com']);
Other less ideal but workable alternatives:
You can give them completely different tracking codes. those. track foo.com and sub.foo.com using different accounts.
You can save them in one account and create separate filters (filtering by host name in the profile settings for each). This will allow you to share the data, but will not solve your referral problem.
Your best bet is No. 1. This will completely solve the problem of referrals.
source share