Cross-domain & subdomain tracking

Track several subdomains — or several different domains — as one site, in one dashboard.

Subdomains (automatic)

Tracking example.com alongside app.example.com, docs.example.com, and friends? Install the same snippet on each subdomain. As long as data-domain is set to your root domain, the first-party visitor cookie is scoped to it — so a visitor is counted once as they move between your subdomains.

<script defer
  data-site="YOUR_SITE_ID"
  data-domain="example.com"
  src="https://piqo.app/piqo.js"></script>

The snippet on your site settings already includes data-domain, so just copy it onto each subdomain and you're done — no extra configuration.

Multiple domains

Have your marketing site on one domain and the app on another — say example.com and example.io? Add data-allowed-hostnames: a comma-separated list of your other root domains (everything except your main data-domain). Put the same attributes on the snippet on every domain.

<!-- the same snippet on example.com AND example.io -->
<script defer
  data-site="YOUR_SITE_ID"
  data-domain="example.com"
  data-allowed-hostnames="example.io"
  src="https://piqo.app/piqo.js"></script>

Several extra domains? Comma-separate them: data-allowed-hostnames="example.io,example.dev". List only the roots — subdomains of anything you list are covered automatically.

How visitors stay unified

Within one root domain (and its subdomains) the first-party cookie keeps a visitor stable. Browsers don't allow a cookie to span two different root domains, so when a visitor follows a link from one of your declared domains to another, Piqo carries their visitor id in the link and hands it off on arrival — then strips it from the URL so the address bar stays clean. Links to anything not in your declared list are never touched, so your visitor id is never shared with third-party sites.

One unavoidable limit (true of every analytics tool): a visitor who opens two of your domains directly, without ever following a link between them, can't be stitched into one — there's nothing to carry the id across. Normal navigation between your domains is covered.

Seeing it in the dashboard

Everything lands in one site. On the Pages tab, switch Break down by to URL to see each host separately (app.example.com/dashboard vs example.com/pricing), or leave it on Path to merge the same path across every host.

Already installed? Re-copy the snippet so it carries data-domain (plus data-allowed-hostnames if you use multiple domains). Until then everything still tracks into one site — visitors just aren't unified across the boundary yet.