Track visitors across different domains
Track visitors seamlessly when they navigate between completely different root domains (e.g., from example.com
to myapp.io
).
Looking to track across subdomains instead? Check out subdomain tracking which works automatically without any setup.
When to use cross-domain tracking
Use cross-domain tracking when you have multiple websites with different root domains that you want to track as a single user journey:
- Marketing site on
example.com
and app onapp.io
- Main site on
mysite.com
and store onshop-mysite.com
- Multiple brand domains that share users
Setting up cross-domain tracking
- Go to your website settings in DataFast
- In the General tab, scroll to "Additional domains"
- Add the other domains you want to track (e.g.,
myapp.io
) - Install the tracking script on all domains with the same website ID, the same
data-domain
attribute, and add thedata-allowed-hostnames
attribute with your additional domain(s):
<script
defer
data-website-id="667a82ed968954a0831e484"
data-domain="myapp.com"
data-allowed-hostnames="myapp.io"
src="https://datafa.st/js/script.js"
></script>
Important: The data-allowed-hostnames
attribute should be a comma-separated list of all additional domains you want to track (excluding your main domain).
How it works
When users click a link to one of your allowed domains, DataFast automatically appends tracking parameters (_df_vid
and _df_sid
) to preserve their visitor and session IDs across domains.
The URL parameters are automatically cleaned from the browser address bar after being captured, keeping your URLs clean.