By default the SDK loads from https://t.trustdata.tech and sends events there. A first-party tracking domain moves both to a hostname you own, such as t.yourdomain.com or yourdomain.com/_td. Requests then count as first-party, and the visitor cookie TrustData sets lives on your domain.
TrustData offers two delivery modes. Pick one in the Delivery mode field.
| Mode | What you set up | Safari cookie life |
|---|---|---|
| CNAME | One DNS record that points a subdomain at t.trustdata.tech | Safari caps the server cookie to 7 days |
| Reverse proxy (first-party, ITP-durable) | A rule on your own web server or CDN that forwards /_td/* to TrustData | The cookie survives Safari |
Choose the reverse proxy when you can run one. Choose CNAME when you can only change DNS.
You need the admin or edit role to change it. Select Save delivery after each change.
t.yourdomain.com. TrustData rejects subdomains of trustdata.tech, trustdata.io and trustdata.com.t.trustdata.tech. The page also tells you to turn on the Cloudflare proxy (orange cloud) for automatic SSL.Until the domain is verified, the field shows Pending and events keep going to the default endpoint.
yourdomain.com. The apex and www spellings both work, whichever you enter._trustdata-verify.yourdomain.com and the value is the token shown on the page. You do not need a CNAME record in this mode.If you change the domain or the delivery mode, TrustData verifies again. It issues a new TXT token, and the record you published before no longer verifies.
The collector reads these parts of each request. A proxy that satisfies all of them gives full cookie durability.
/_td/ and remove the /_td prefix. The collector serves /t.js, /api/events, /api/config/... and /m/..., and does not know /_td. For example, /_td/api/events must arrive as /api/events.X-Forwarded-Host. Set it to your domain. The collector matches your attribution ID to your verified domain with this header. Without it, the collector falls back to the Host header, finds no domain, and sets no durable cookie. If the header holds a comma-separated list, the collector reads the first entry.X-Forwarded-For. Put the visitor's IP address first. For a verified reverse proxy domain, the collector reads the first entry that is a valid IP address. Without it, every visitor appears at the address of your proxy.X-Forwarded-Proto. Send https. The collector writes the script's own origin from it.Cookie and Set-Cookie. Pass the request Cookie header and the response Set-Cookie header through unchanged. The collector sets the _trdt_vid_s cookie as HttpOnly with Path=/_td, and only when the visitor has granted analytics consent./_td. If you mount the proxy on another path, send it in X-Forwarded-Prefix, for example /analytics. The collector uses it as the cookie path. Without the header it assumes /_td.location /_td/ {
proxy_pass https://t.trustdata.tech/; # the trailing slash removes /_td/
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_ssl_server_name on;
}
handle_path /_td/* {
reverse_proxy https://t.trustdata.tech {
header_up Host {upstream_hostport}
header_up X-Forwarded-Host {host}
}
}
For other web servers and CDNs, apply the same six rules from the list above.
Select Test proxy in the Verify the domain section. TrustData sends an empty request to https://yourdomain.com/_td/api/events and reads the collector's reply. The test confirms three things: the proxy reaches the collector, it removes the /_td prefix, and it forwards X-Forwarded-Host.
The test fails in these cases:
X-Forwarded-Host, or the domain is not verified yet.X-Forwarded-Host to your domain.Verify the domain before you test, because an unverified domain returns no host.
TrustData also repeats this check once a day for every verified reverse proxy domain. The result appears under the Tracking domain section as Last check passed or Last check failed. If the check fails twice in a row, TrustData raises a critical alert named Reverse proxy broken for your domain. The alert closes when a later check passes.
After the domain is verified, Installation code on the attribution ID page uses your domain. For a reverse proxy it loads the script from /_td/t.js and sets apiHost to /_td. Copy that code to your site.
<script src="/_td/t.js"></script>
<script>
trustdata.init('ATTRIBUTION_ID', { apiHost: '/_td' });
</script>
The paths are relative, so the apex and www hostnames both work. Events that arrive on your verified domain without an attribution_id are assigned to the attribution ID that owns the domain.
Returning Safari visitors count as new after 7 days. The proxy does not send X-Forwarded-Host, or you use CNAME mode. Add the header or switch to the reverse proxy.
Every visitor shows one location or one IP address. The proxy does not send X-Forwarded-For. Events still arrive.
No cookie is set. The event carried no analytics consent, or the proxy removes Set-Cookie. The collector sets the cookie only with analytics consent and only on a verified domain.
Verify DNS fails. The record has not propagated yet, or its value is wrong. In reverse proxy mode, check the TXT record at _trustdata-verify.yourdomain.com.