Analytics - (Cross-site | Cross-domain) tracking - Site linking


cross-site tracking is a tracking technique that permits to follow a user across web sites (ie to follow users from site to site)

Cross-domain measurement makes it possible for Analytics to see sessions on two related sites (such as an ecommerce site and a separate shopping cart site) as a single session. This is sometimes called site linking.


You can follow users from site to site by:

Query String

<a href=""></a>

This method will not be fully accurate especially when the user share the URL. One way to avoid this problem is to append:

  • a timestamp to implement a validity. (ie if the id has a timestamp of more than 3 minutes, the id value is not valid)
  • the user agent string or other browser or device-specific metadata. (if the metadata does not match, you'll know the client ID originated from someone else)



Google Analytics

For Google Analytics, see Set up cross-domain measurement (analytics.js)

ga('create', 'UA-XXXXX-Y', '', {
  'name': 'sampleTracker',
  'allowLinker': true,
  'cookieDomain': ''
ga('sampleTracker.require', 'linker');
ga('sampleTracker.linker:autoLink', ['']);
ga('sampleTracker.send', 'pageview');

Documentation / Reference

Powered by ComboStrap