Analytics
2.6K members online now
2.6K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Understanding traffic source calcuation

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

My GA code is running on domain1.com. When visitor migrates from domain1.com to domain2.com, I pass along the client id from domain1.com to domain2.com in the url as hash param (domain2.com#GA_CLIENT_ID=<>) and the JS running on domain2.com reads that client id from url and uses it while initializing the GA tracker. For domain2.com the source is being shown as direct. Now when visitor migrates from domain2.com to subdomain.domain2.com, the source is now being shown as domain2.com. Why?

On domain2.com I have my code using linker plugin

 

ga('linker:autoLink',['domain2.com','subdomain.domain2.com'],true,true);

How does GA identifies source ? I thought it was based on the client id value. If client id remains same across multiple domains, the source for all those domains should be the source that generated the client id in the first place. Right?

1 Expert replyverified_user

Re: Understanding traffic source calcuation

Top Contributor
# 2
Top Contributor
Hi :-)
Are you only cross domain tracking between domain1.com and domain2.com
or
is there also cross domain tracking occuring from domain1.com and subdomain.domain2.com as well?

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Re: Understanding traffic source calcuation

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Yes cross domain is happening from domain1.com to subdomain.domain2.com as well.

Looks like irrespective of cross domain tracking from domain1.com to domain2.com, if a visitor goes from domain1.com to domain2.com and lets say comes back from domain2.com to domain1.com, upon return GA creates a new session on domain1.com and the source will be set to domain2.com
This I guessed can be fixed by adding domain2.com to referral exclusion list. Correct me if I am wrong.

Re: Understanding traffic source calcuation

Top Contributor
# 4
Top Contributor

Yes both domain1.com and domain2.com should be on the referal exclusion list
That is a requirement with cross domain tracking.

 

When tracking between a domain and one of its own subdomains, no special linking/tracking setup
is required

From the dev docs - 

   ... Automatic cookie domain configuration sets the _ga cookie on the highest level domain it can. For example, if your website address is blog.example.co.uk, analytics.js will set the cookie domain to .example.co.uk....

... When using automatic cookie domain configuration, your users will be tracked across subdomains without any extra configuration.

https://developers.google.com/analytics/devguides/collection/analyticsjs/cookies-user-id#automatic_c...


chirag j wrote:
On domain2.com I have my code using linker plugin
ga('linker:autoLink',['domain2.com','subdomain.domain2.com'],true,true);

is not required for subdomain tracking between domain2.com and subdomain.domain2.com

 

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here