Docs

CNAME subdomain

When you cannot run any code in front of your site, a subdomain of your own domain can point at the 3x API. Requests then go to https://t.example.com/v1/e – same site as your pages.

Setup

  1. Ask the operator of your 3x deployment for the CNAME target and to add t.example.com as a custom domain of the API (self-hosted on Vercel: Project → Settings → Domains of the API project; TLS is issued automatically).
  2. Create the DNS record:
dns/example.com.zone
t.example.com.  3600  IN  CNAME  api.3x.example.

Use the host name of your API origin ({{API_ORIGIN}} without https://) as the target.

  1. Point the snippet at it:
index.html
<script async src="https://t.example.com/v1/s/x3.full.js?k={{PUBLISHABLE_KEY}}" data-key="{{PUBLISHABLE_KEY}}" data-host="https://t.example.com"></script>

Verify

curl -s -o /dev/null -w "%{http_code}\n" https://t.example.com/v1/health

Prints 200. The network tab shows POST https://t.example.com/v1/e → 204.

Limits

  • Visitor IPs are exact – the browser connects to the API directly, no proxy key needed.
  • Ad blockers: most block lists match host names and paths; a neutral subdomain is usually not listed. Some blockers (uBlock Origin on Firefox) resolve CNAMEs and can still block it, so a path proxy is stronger.
  • Cookies: the browser sends cookies scoped to .example.com to t.example.com. 3x ignores them and never sets any, but if your site sets wide-scoped cookies, prefer a path proxy that strips them.
  • connect-src and script-src need https://t.example.com in your CSP.