Cross-Domain Tracking: How to Follow Visitors Across Multiple Sites
Plenty of businesses run on more than one domain. Your marketing site lives on example.com, your app on app.example.io, and your checkout on a payment provider's domain. A visitor moves through all three in a single journey — but to standard analytics, that one person looks like three separate visitors. Cross-domain tracking fixes this by keeping one real visit as one session, even as the domain changes.
Why Sessions Break Between Domains
Analytics identifies a returning visitor using an identifier — typically a value stored in a first-party cookie or in localStorage. By design, that storage is scoped to a single domain. A cookie set on example.com is completely invisible to app.example.io. When the visitor crosses from one domain to the other, the second site can't read the first site's identifier, so it generates a brand-new one and starts a fresh session.
The result is double-counting and broken journeys. A single person who reads your homepage, clicks through to your app, and signs up appears as: one visitor on the marketing site who "bounced," plus a separate, brand-new "direct" visitor on the app. The referral chain that connects them is lost, and your referral traffic data gets messy.
How Cross-Domain Tracking Works
Since the destination domain can't read the source domain's stored ID, the trick is to carry the ID across in the link itself. When a visitor clicks a link from example.com to app.example.io, the tracker appends the visitor's ID to the destination URL as a query parameter. The destination site reads that parameter on arrival and adopts the same ID instead of minting a new one.
The link decoration pattern
The two sites must share the same analytics property and agree on the parameter name, so the handoff is recognized rather than treated as just another UTM tag. Done correctly, the visitor keeps one ID for the entire journey and the session stays intact.
www.example.com, app.example.com), you can set the cookie at the root-domain level (.example.com) and skip link decoration entirely. True cross-domain tracking is only needed when the registered domains differ.What Cross-Domain Tracking Reveals
Once sessions are stitched together, you can see journeys that were previously invisible:
| Without stitching | With cross-domain tracking |
|---|---|
| 2 visitors, both "bounced" | 1 visitor, 6-page journey |
| App signups look "direct" | Signups credited to the blog post that started them |
| Two short sessions | One accurate session duration |
This matters most for attribution. Without it, the marketing content that actually drives signups gets no credit, because the conversion happens on a different domain that records the visit as "direct." With it, you can finally trace a paid signup back to the specific article or ad that started the journey — the foundation of any honest funnel analysis.
Things to Watch Out For
- Keep the parameter clean: The handoff parameter should be stripped from the visible URL after it's read, so it doesn't end up shared or indexed.
- Respect privacy: The visitor ID should be an anonymous random token, never anything personally identifying. Cross-domain stitching doesn't require knowing who someone is — only that it's the same anonymous session.
- Match your domain list exactly: Only decorate links to domains you actually own and track. Decorating every outbound link would leak your IDs to third parties.
- Test the full path: Walk the real journey — marketing site → app → checkout — and confirm in your analytics that it shows up as one session, not three.
Track every domain you own from one statpx account
Add multiple sites under one login, organize them with tags, and see each property's traffic side by side. Start free and connect your whole web presence in minutes.
Start tracking free →The Bottom Line
If your customer journey spans more than one domain, default analytics is quietly miscounting your visitors and misattributing your conversions. Cross-domain tracking carries a single anonymous identifier across the handoff so one real person stays one session from first click to final conversion. Set it up once, verify it by walking the journey yourself, and your attribution and session numbers will finally reflect reality. For the basics of getting tracking onto each site first, see our guide to installing the tracking snippet.