Source: https://usedataowl.com/docs/cross-domain-tracking
Markdown source: https://usedataowl.com/docs/cross-domain-tracking.md
Description: Seamlessly track a single visitor session and revenue attribution across multiple root domains, marketing sites, and external checkout subdomains.

# How to Set Up Cross-Domain Visitor & Revenue Tracking

Track visitors as they move between different root domains, such as `example.com` and `myapp.io`, as one journey.

> Subdomains need nothing: `app.example.com` and `blog.example.com` are already part of `example.com`, and the cookie script shares its visitor across them.

## When to use it

- A marketing site on `example.com` and the app on `myapp.io`
- A store on its own domain next to your main site
- Several brand domains that share customers

## Set it up

1. In your site's **Settings → Additional domains**, add the other domains (for example `myapp.io`). Events from them are accepted from then on.
2. Install the script on every domain with the **same site ID**, and list the other domains in `data-allowed-hostnames`:

```html
<script
  defer
  data-website-id="YOUR_SITE_ID"
  data-allowed-hostnames="myapp.io"
  src="https://usedataowl.com/js/script.cookies.js"
></script>
```

`data-allowed-hostnames` is a comma-separated list of your other domains, without the one the page is on.

## How it works

When a visitor clicks a link to one of those domains, the script adds `_ds_vid` and `_ds_sid` to the link, and the script on the other side continues the same visitor and session, then removes the parameters from the address bar.

## Allow all domains

**Allow all domains** accepts events from any domain. Use it for embedded widgets or customer-owned domains you can't list in advance.
