Cross domain tracking in GA

195 Views Asked by At

Need a help regarding a doubt over cross domain tracking in GA.

We got three domain abc.com, pqr.com, xyz.com. For cross domain tracking I am using the below code, my questions are:

  1. In order to use same code on all three domains, I am including source domain in the line #3 of the code, instead of including only destination domains in the array as suggested by google… would it be a problem?

  2. What is difference if I am passing linker parameters in anchor portion of the URL (instead of the query portion)?

Any help would be highly appreciated. Thanks in advance

  ga('create', 'UA-xxxxxxx-x', 'auto',{'allowLinker': true});
  ga('require', 'linker');
  ga('linker:autoLink', ['abc.com','pqr.com','xyz.com'], true, true); 
  ga('require', 'displayfeatures');
  ga('send', 'pageview'); // Send page view for global tracker
1

There are 1 best solutions below

0
On
  1. Including source domain is not a problem, but it does not make any sense.
  2. Do it only if you know why. For instance when you have AJAX driven webpage (Single Page Website)

Anyway, do not forgot to exclude referrals from your domains: https://support.google.com/analytics/answer/2795830?hl=en&ref_topic=2790009