About
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.
Method
Cookie
You can follow users from site to site by:
- merging various cookie identifiers into a profile.
- using tracking cookie via an embedded resource (library, image, …)
Query String
<a href="https://destination.com/?clientId=XXXXXX">destination.com</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)
Iframe
https://developers.google.com/analytics/devguides/collection/analyticsjs/cross-domain#iframes
Provider
Google Analytics
For Google Analytics, see Set up cross-domain measurement (analytics.js)
ga('create', 'UA-XXXXX-Y', 'mystorefront.com', {
'name': 'sampleTracker',
'allowLinker': true,
'cookieDomain': 'mystorefront.com'
});
ga('sampleTracker.require', 'linker');
ga('sampleTracker.linker:autoLink', ['mystorefront.com']);
ga('sampleTracker.send', 'pageview');