Why first-party
Most analytics load from a shared vendor domain. Browsers and blockers treat that as third-party, so a large share of traffic never gets counted. Serving from your own domain changes that.First-party makes analytics harder to block, not unblockable. DNS-level blockers and strict anti-CNAME modes can still opt out — which is the privacy-respecting outcome.
How it works
You add one CNAME record so a short subdomain of your site (for examplem.yourdomain.com) resolves to Sapt’s ingest. Sapt issues the TLS certificate for it automatically. From then on:
- The browser loads the tracking script from your subdomain.
- The script sends each event back to that same subdomain — so the whole exchange is first-party.
- Sapt enriches each event (source, campaign, location, device) on the server and shows it in your analytics dashboard.
Set it up
1. Get your tracking subdomain
In the Sapt dashboard, open Analytics → Tracking and enter your site’s root domain (e.g.yourdomain.com). Sapt picks a short, neutral subdomain for you and shows the exact DNS records to add.
2. Add the DNS records
Add both records the dashboard shows you, at your DNS provider:3. Wait for it to go live
DNS changes take anywhere from a few minutes to a few hours. The Tracking page shows the status and a Check status button. Once it reads Active, your certificate is issued and you’re ready for the script.4. Add the tracking script
Paste the snippet from the dashboard into your site’s<head> (it includes your assigned host and Project ID):
Track custom events
Once the script is loaded it exposes a small global API for events that matter to your business:getVisitorId() returns the value of the first-party _sapt_vid cookie — a random ID with no personal data. Sending it to your backend lets you stitch anonymous visits to CRM records later.
Calling identify() (or a tracked form submit) is also what moves a visitor from anonymous to identified — see Visitors & identity resolution.
Captured automatically
You don’t need to instrument these — the script records them out of the box:Hand it to your coding agent
Let an AI coding assistant do the install. The button below copies a ready-made prompt that points your assistant at this page and keeps the setup clean — just fill in your tracking host and Project ID from the dashboard.Setup prompt
Privacy notes
- One first-party cookie,
_sapt_vid, holds a random ID — no names, emails, or cross-site identifiers. - Geo and device details are derived on Sapt’s server from the request; nothing extra is collected in the browser.
- Because there’s no third-party tracker, the script alone doesn’t require a consent banner — but follow the rules for your own region and any other tools on your site.