> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crispstats.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> CrispStats is a hosted, privacy-first analytics product. It has no self-hosted edition, no session replay, no heatmaps, no A/B testing and no data import except a site's history from a Plausible export (Settings, Import and export). Websites use the script. iOS, Android, React Native and Flutter use the mobile SDKs in the install guides. Those SDKs are source files, not a published package, and they do not read an advertising id.
> The script global is crispstats(...), site keys start with cs_pk_ and secret API keys start with cs_sk_. The script is served from https://in.crispstats.com/d.js and the REST API lives at https://crispstats.com/api/v1.
> The script tag is the main install; the npm package @crispstats/tracker does the same from code, never alongside the tag. Integrations copy the script tag, the queue stub, crispstats.d.ts and proxy code from these docs or from Settings, Tracking code in the dashboard. A first-party proxy forwards one path of the site to https://in.crispstats.com/p/ and forwards only content-type, user-agent, accept-language, referer, origin, if-none-match and x-forwarded-for, never cookies.

# Track one site across several domains

> Count a marketing site, an app and a checkout on different domains as one site in CrispStats: which hostnames to add, what counts as the same visit, and the one case where visitors split.

A product often lives on more than one hostname: `example.com` for the marketing site, `app.example.com` for the product, `example.shop` for the store. CrispStats can count all of them as one site, so a visitor who reads the pricing page and then signs up in the app is one visitor with one visit, and the source that brought them is kept.

There is nothing to link and no parameter to add to your URLs. Put the same snippet on every hostname and tell the site which hostnames it owns.

## Set it up

**1. Use one site for all the hostnames**

Install the same snippet, with the same `data-site` key, on every domain and subdomain. Do not create one site per domain if you want them counted together.

**2. Add the hostnames to the site**

Open **Settings**, **General** and add each extra hostname under **Additional hostnames**, for example `app.example.com` and `example.shop`. Subdomains of the site's domain are counted without this as long as the list is empty; once you add any hostname, list every one you use. See [how the domain and hostnames decide what is counted](https://docs.crispstats.com/account/sites-and-settings.md#how-the-domain-and-hostnames-decide-what-is-counted).

**3. Copy the updated snippet**

Open **Settings**, **Tracking code** and deploy the snippet again on each hostname. Its `data-domains` now lists every hostname, so the script tracks on all of them and nowhere else. If you write the tag by hand, list them yourself: `data-domains="example.com,example.shop"`. See [data-domains](https://docs.crispstats.com/tracking/script-attributes.md).

## What counts as one visit

| Moving between your hostnames | Result |
| - | - |
| The referrer | A click from one of your hostnames to another is not a referral. The visit keeps the source it started with, and the second hostname does not show up under **Sources**. |
| The visitor, in the default privacy mode | One visitor. The daily visitor id comes from the site, not the hostname, so the same browser on the same day is the same visitor on every hostname. |
| The visit | One visit, while the visitor stays active within the session timeout. |
| Pages | Each page keeps its hostname. Break down or filter by **Hostname** to see each domain on its own. |
| Goals and funnels | A funnel can start on one hostname and finish on another. |

## The one case where visitors split

With [persistent visitors](https://docs.crispstats.com/privacy/persistent-visitors.md) on, the script keeps a random id in the browser's `localStorage`. Browsers keep `localStorage` separately for each hostname, so `example.com` and `example.shop` each get their own id, and one person counts as two visitors there. CrispStats does not pass the id between domains in the URL, and it does not set cookies.

Subdomains are affected in the same way: `example.com` and `app.example.com` have separate storage too.

To join a person across domains with persistent visitors on, [identify them](https://docs.crispstats.com/track/identify-users.md) once they sign in: identified visitors are matched by your user id on every hostname.

## Separate sites instead

Create one site per domain when the domains are different products with different audiences, or when different people should see them. Each site then has its own numbers, settings, team access and plan usage, and a click from one to the other counts as a referral.

## Next steps

> [card] [Sites and settings](https://docs.crispstats.com/account/sites-and-settings.md)
>
> The domain, additional hostnames and what each one counts.

> [card] [Identify users](https://docs.crispstats.com/track/identify-users.md)
>
> Join one person's visits across devices and domains.

> [card] [Script attributes](https://docs.crispstats.com/tracking/script-attributes.md)
>
> `data-domains` and every other option on the tag.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.