Server-Side TrackingGuideAdvanced

First-party tracking domains: verification, what ITP still caps, and what a custom domain does not fix

Why the collector and SDK should be reached through a subdomain of your own site, how domain verification and the CNAME check work, which browser limits still apply to script-written cookies, and what to add to your Content Security Policy.

By
Track editorial team
Published
Last reviewed
Reading time
3 min read

Key takeaways

  • A tracking subdomain of your own site keeps consented requests off blocklists and outside third-party cookie restrictions, with only one extra host in your CSP.
  • The domain becomes active only after verification by DNS TXT record, file or meta tag plus a passing CNAME check; TLS is terminated at the platform edge.
  • The SDK writes _ts_id, _ts_sid and _ts_cid only after the matching consent, and Safari's 7-day cap on script-written storage still applies — the custom domain protects delivery, not identifier lifetime.
  • It does not restore denied purposes, does not make vendor pixels first-party and hides nothing from the visitor.

What a first-party domain changes

Requests to t.shop.example are same-site with shop.example. Three things follow:

  1. Blocklists do not match. Most content blockers match hostnames; a subdomain of your own site is not on them. This is not evasion of a user choice — the consent decision still gates every purpose — it removes collateral blocking of consented, first-party requests.
  2. Third-party cookie restrictions do not apply. Browsers that partition or block third-party cookies leave same-site storage alone.
  3. Your security policy stays tight. One extra host in script-src and connect-src, no wildcard vendor domains for the collector path.

The setup

  • Add the domain in the site settings. Track issues a verification token; prove control with a DNS TXT record, a file on the domain or a meta tag. The domain becomes active only after verification succeeds, so nobody can point a domain they do not control at your site.
  • Create t.shop.example as a CNAME to the collector host shown in the settings. The domain page records when the CNAME check last passed.
  • TLS for the tracking host is terminated by the platform edge once the CNAME resolves.
  • Update your Content Security Policy: script-src and connect-src need the tracking host. No unsafe-inline is required because the loader is an external script.
  • The SDK loader is then served through the tracking host together with the site's signed configuration.

What the SDK stores, and what ITP still caps

Track writes three things in the browser, each only after the matching consent:

KeyPurposeWritten whenLifetime
_ts_id (cookie, mirrored in localStorage)anonymous visitor idanalytics or marketing consentup to 13 months, or the site's retention
_ts_sid (session storage)session idanalytics or marketing consent30 minutes rolling
_ts_cid (localStorage)click ids from the landing URLmarketing consentclick-id TTL, 90 days by default

Click ids from the landing URL are kept in localStorage under _ts_cid, only with marketing consent and only for the site's click-id TTL (90 days by default); they are attached to every later event of the visit and cleared when marketing consent is withdrawn.

Both identifiers are written by JavaScript. Safari's Intelligent Tracking Prevention caps script-written cookies and storage at 7 days (24 hours when the landing URL carried a known tracking parameter), and a first-party domain does not lift that cap. The collector does not set cookies through HTTP responses, so a returning Safari visitor after more than a week is a new anonymous id. Firefox and Brave apply comparable heuristics; Chrome keeps first-party storage for its full expiry.

The honest summary: the custom domain protects request delivery; it does not extend identifier lifetime on Safari.

What a first-party domain does not fix

  • It does not restore consent-denied purposes. Without marketing consent no click id is captured and no advertising destination receives events, regardless of domain.
  • It does not make vendor pixels first-party. fbevents.js still loads from Meta and sets _fbp; only the collector path is yours.
  • It does not hide anything from the visitor. The tracking host, the SDK source and the collector endpoints are visible in developer tools, and the privacy page lists them.

Checklist

  • To do: Domain verified (TXT, file or meta tag) and CNAME check passed
  • To do: CSP updated for script-src and connect-src
  • To do: Snippet references the tracking host, not the platform default
  • To do: Data quality page shows browser events arriving from the new host

Primary sources

Documentation and standards this article is based on.

  1. WebKit — CNAME cloaking and bounce tracking defensewebkit.org
  2. MDN — Set-Cookiedeveloper.mozilla.org

Was this article helpful?

Responsible editor

Track editorial team

Product & engineering

The people building Track: engineers and analysts who work on server-side tracking, consent tooling and connector integrations every day.