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. Choose your tracking address
In the Sapt dashboard, open Project Settings and then Domains. In Connect a domain, enter the Domain you own (for exampleyourdomain.com) and tick First-party tracking. The Tracking address fills in as m.yourdomain.com; change it if you like. Click Save domain settings.
2. Add the DNS record
Add the record the Domains screen 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 address moves from Waiting for records to Issuing certificate to Live. Click Check connection to check again.4. Add the tracking script
Open Analytics, go to Setup, and open the Tracking step. Choose Your own domain and paste the snippet into your site’s<head>. It includes your tracking address 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. Copy the prompt below, fill in your tracking host and Project ID from the dashboard, and paste it into your assistant.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. Follow the rules for your own region and any other tools on your site.