Cross-Domain Subdomain Tracking with Google Analytics

I just installed Google Analytics Cross-Domain Tracking.
I have seen some examples of this, but would like to make sure that I did it right.
The documentation that I followed is here: http://support.google.com/analytics/bin/static.py?page=guide.cs&guide=1034143&topic=1033979

I basically have 3 websites, all subdomains.

one.mysite.com
two.mysite.com
three.mysite.com

I added the following lines to the Google Analytics default script and made sure to use the same value for _setAccount.

_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);

Now ... the part that I'm a little confused with is the _setDomainName variable.

Should I leave it “no” on all three websites and let _setAllowLinker do this work, or do I mean to specify the domains individually, as shown below?

_gaq.push(['_setDomainName', 'one.mysite.com']); // used on one.mysite.com
_gaq.push(['_setDomainName', 'two.mysite.com']); // used on two.mysite.com
_gaq.push(['_setDomainName', 'three.mysite.com']); // used on three.mysite.com
+5
source share
1 answer

For cross-subdomain traffic you do not need to install _setAllowLinker, although there is no harm. This feature allows you to send Google Analytics cookies for cross-domain tracking. This functionality activated by the function _linkis not needed for your use.

setDomainName "", , 1 . , .

(, foo.bar.example.com), , , :

 _gaq.push(['_setDomainName', 'mysite.com']); // used on any mysite.com domain or subdomain

, , mysite.com , :

 _gaq.push(['_setDomainName', '.mysite.com']); // used on any mysite.com domain or subdomain as well as third level subdomains

, . -, , cookie ( 2 ), , " ", cookie Google Analytics. Google Analytics " " cookie; , setDomainName, , cookie, ga.js, cookie (, , , .)

+8

All Articles