Cross-Domain Tracking: Tracking Visitors Across Multiple Domains

Home / Everything About / Everything About Analytics / Cross-Domain Tracking: Tracking Visitors Across Multiple Domains

You operate multiple websites. Your marketing domain drives traffic. Your product domain is where visitors explore features. Your help center supports existing customers. Each domain serves a purpose. But visitors move between them constantly. A typical visitor lands on your marketing site, moves to your product to test it, visits help documentation to understand a feature, then returns to marketing to compare pricing. Without cross-domain tracking, your analytics sees four separate visitors making four independent decisions. The actual journey is invisible. The conversion path is unknowable. With cross-domain tracking, you connect these fragments. You see the real visitor journey.

This article explains how to set up cross-domain tracking.

Why Cross-Domain Tracking Matters**

Visitors don't stay on one domain. They move between your properties. A visitor reads your blog. Then visits your product. Then accesses help documentation. These are on different domains. Without cross-domain tracking, you see three visitors. Not one visitor moving across three properties.

Cross-domain tracking lets you understand visitor behavior across properties. How many visit your blog then convert. How many visit help then upgrade. What path do visitors take. This insight helps you optimize across properties.

Cross-domain tracking also helps with attribution. A visitor comes from ads. They visit a landing page on domain A. Then check your product on domain B. Where should you attribute the conversion. Cross-domain tracking captures the full path.

Understand Cookie Domains**

Analytics uses cookies to identify visitors. Cookies are domain-specific. A cookie set on domain.com doesn't work on subdomain.domain.com. A cookie on domain1.com doesn't work on domain2.com.

For tracking across domains, you need to link them. You need to pass visitor identification from one domain to another. This requires configuration.

Subdomains are easier than different domains. Subdomains like blog.domain.com and app.domain.com can share cookies. Different domains like domain1.com and domain2.com cannot share cookies naturally. You need to pass a parameter.

Link Related Domains**

Tell your analytics platform which domains are related. In Google Analytics, you link domains in the property settings. You list all domains that should be tracked together. Analytics then shares visitor identification across them.

Linking domains is a configuration step. It doesn't require code changes. You configure it once. It applies to all tracking on those domains.

Be careful what you link. Only link domains you control. Don't link to third-party domains. Only link domains that are part of your property.

Use URL Parameters for Domain Linking**

When you link a visitor from one domain to another, pass a parameter. This parameter identifies the visitor. The new domain reads the parameter. It knows who the visitor is.

The parameter is usually a campaign or referral parameter. When you link from domain A to domain B, include the visitor ID in the URL. Domain B reads it. It associates the session with the visitor.

This works automatically with most platforms if you've configured domain linking. The platform adds the parameters automatically. You don't need to manually add them.

Handle Authentication Across Domains**

If your domains require login, cross-domain tracking is easier. Users log in on one domain. Their session follows them to other domains. Analytics can use their login to identify them.

Use your authentication system as the visitor identifier. When a user is logged in, you know who they are. This is more reliable than cookies.

Make sure your authentication spans all domains. A user logs in on domain A. They should be logged in on domain B. Single sign-on makes this easier.

Test Cross-Domain Tracking**

After configuration, test it. Navigate from domain A to domain B. Check that analytics treats it as one visitor. Check real-time reports. Do you see the session spanning both domains.

Use browser cookies to verify. Open DevTools. Look at cookies on each domain. Verify the analytics cookie has the same value or is being passed correctly.

Test with different scenarios. Logged in users. Anonymous users. Different traffic sources. Verify tracking works in all cases.

Exclude Internal Cross-Domain Links**

Some cross-domain links are internal. You link from your marketing site to your product. This is intentional. You want to track it.

But some cross-domain links shouldn't be tracked. CDN domains. Whitelist domains. API domains. These aren't user-facing. Exclude them from cross-domain tracking if they're just infrastructure.

Frequently asked questions

Do we need cross-domain tracking if we use subdomains?

Does cross-domain tracking work on mobile apps?

What if we unintentionally link a third-party domain?

Can we track visits from one domain to a third-party domain?

Does cross-domain tracking require consent?

How do we know if cross-domain tracking is working?