Troubleshooting

Cross-Domain and Subdomains

SourceTag stores attribution data in a first-party cookie on your domain. How this cookie is shared (or not shared) depends on whether you’re dealing with subdomains or entirely different domains.

Subdomains (same top-level domain)

SourceTag sets the cookie with the domain attribute set to the root domain by default. This means subdomains of the same root domain share the same cookie.

For example, if your root domain is example.com, the cookie domain is set to .example.com. This cookie is accessible on:

  • example.com
  • www.example.com
  • blog.example.com
  • shop.example.com
  • app.example.com

A visitor who lands on blog.example.com with UTM parameters and later fills in a form on example.com will have their attribution data carried across. Both subdomains read from and write to the same _sourcetag cookie.

How this works in practice

  1. Visitor clicks a Google Ads link to blog.example.com/guide?utm_source=google&utm_medium=cpc
  2. SourceTag on blog.example.com sets the cookie on .example.com
  3. Visitor navigates to example.com/contact
  4. SourceTag on example.com reads the cookie (shared via .example.com)
  5. Visitor submits the contact form with full attribution data

This is the default behaviour. No configuration is needed.

Multiple sites in SourceTag using subdomains

If you have separate SourceTag sites for blog.example.com and example.com, they’ll share the same cookie. The script on each subdomain will read and update the same attribution data. This is usually the desired behaviour, as it gives you a complete picture of the visitor’s journey across your subdomains.

If you specifically want each subdomain to have its own independent attribution tracking (uncommon), you can change the cookie name in the SourceTag dashboard for one of the sites. Different cookie names mean separate attribution trails.

Different top-level domains

Different root domains do NOT share cookies. This is a fundamental browser security restriction that SourceTag cannot override.

For example, these domains have completely separate cookies:

  • example.com and example.co.nz
  • example.com and myotherbrand.com
  • example.com and example.net

A visitor who lands on example.com with UTM parameters and later visits myotherbrand.com will start a fresh attribution trail on the second domain. The cookie from the first domain is not accessible on the second.

What this means for your tracking

If you run multiple domains, each domain has its own independent attribution tracking. A visitor’s journey is only tracked within a single domain (and its subdomains).

For example:

  • Visitor lands on example.com via Paid Search
  • Visitor later visits shop.myotherbrand.com via a link on example.com
  • On shop.myotherbrand.com, the visitor is attributed as Referral (from example.com), not Paid Search

Each domain tells its own attribution story.

Running multiple domains with SourceTag

If you have multiple domains, set each one up as a separate site in your SourceTag dashboard. Each site gets its own script, its own cookie, and its own attribution data.

This is the correct approach. Cross-domain cookie sharing isn’t possible (or desirable from a privacy perspective), so each domain should be tracked independently.

Country-specific domains

If your business uses country-specific domains (e.g. example.com, example.co.uk, example.co.nz, example.com.au), these are treated as separate top-level domains. Each one needs its own SourceTag site.

Attribution data from one country domain does not carry over to another.

Cookie domain auto-detection

SourceTag automatically detects the root domain from the current hostname and sets the cookie domain accordingly. For example, if the script runs on blog.example.com, it sets the cookie on .example.com. This means subdomain tracking works out of the box with no configuration needed.

The auto-detection handles common patterns:

  • www.example.com sets cookie on .example.com
  • blog.example.com sets cookie on .example.com
  • app.staging.example.com sets cookie on .example.com

If you need to change the cookie domain (e.g. to restrict the cookie to a specific subdomain rather than sharing it across all subdomains), you can configure this in the SourceTag dashboard under your site’s Settings > Cookie Configuration section.

See Cookie Settings for details.

Summary

ScenarioCookie shared?Configuration needed?
example.com and www.example.comYesNone
example.com and blog.example.comYesNone
example.com and shop.example.comYesNone
example.com and example.co.nzNoSeparate sites
example.com and myotherbrand.comNoSeparate sites

Further reading