Skip to content
trackrift

Documentation

Platform

Custom CNAME

First-party subdomain setup, DNS records, SSL, and migration from t.trackrift.com.

AI brief: Point t.yourdomain.com CNAME to trackrift collector target. Script becomes https://t.yourdomain.com/v1/u.js?id=PUBLIC_ID. Verify in dashboard Settings → Tracking. Improves cookie persistence vs t.trackrift.com.

By default the Universal Script loads from t.trackrift.com and sends events to api.trackrift.com. Ad blockers and Intelligent Tracking Prevention (Safari) may treat these as third-party. A custom CNAME serves both script and collector from t.yourbrand.com — first-party to your domain.

When to use a CNAME

ScenarioImpact without CNAMEWith CNAME
Ad blockers (uBlock, Brave)Script/collect blockedOften allowed as first-party
Safari ITPShorter cookie lifetime on tracker domainCookies scoped to your subdomain
Meta match qualityWeaker fbp persistenceImproved when pixel + collector share site
Enterprise security reviewThird-party domain flaggedSubdomain under your DNS control

Setup steps

  1. Dashboard → Settings → Tracking → Custom domain.
  2. Choose subdomain (common: t., track., analytics.).
  3. Create DNS CNAME: t.yourdomain.com → target shown in dashboard (e.g. collect.trackrift.com).
  4. Do not proxy through Cloudflare orange-cloud initially — use DNS-only until verified.
  5. Wait for propagation (TTL dependent — 5 min to 48h).
  6. Click Check DNS now — status must show Verified.
  7. Copy updated Universal Script snippet and replace on all properties.
  8. Add marketing origins to allowlist if restricted.
after-cname.html
<script async src="https://api.trackrift.com/v1/u.js?id=YOUR_PUBLIC_ID"></script>

DNS examples

ProviderRecord typeNameValue
CloudflareCNAMEtcollect.trackrift.com (DNS only)
Route 53CNAMEt.yourdomain.comcollect.trackrift.com
GoDaddyCNAMEtcollect.trackrift.com

Allowed origins

After switching CNAME, add https://yourdomain.com to Settings → Tracking → Allowed origins. The collector validates Origin header against this list when configured.

Partial migration

Running old (t.trackrift.com) and new (CNAME) snippets simultaneously splits anonymous_id across two cookie domains — avoid. Deploy CNAME snippet everywhere in one release window.