# Serve the script from your own domain

> Point a subdomain at Statsy and the script and its beacons become first-party, so ad blockers leave them alone.

Section: Tracking script  
Canonical page: https://statsy.co/docs/tracking-script/first-party-domain  
Last updated: 2026-09-15

By default the script is served from `https://statsy.co`, and some ad blockers block requests to any analytics host. A proxy host puts the script and its beacons on a subdomain of your own site instead, which blockers treat as first-party.

## Set it up

1. Add a DNS recordCreate a CNAME from the subdomain you want to the Statsy proxy endpoint.text`s.yourstartup.com. CNAME proxy.statsy.co.`
2. Save the hostname in StatsyOpen **Site settings › Tracking › Proxy host**, enter the same hostname, and save.
3. Update the tagChange the `src` on your tag to the proxy host. Nothing else about the snippet changes, and the install screen prints the new version for you.html`<script defer data-website-id="ws_XXXXXXXX" data-domain="yourstartup.com" src="https://s.yourstartup.com/js/script.js"></script>`

## Certificates are automatic

A certificate is issued for your hostname on its first request, once the DNS record resolves. It only happens for hostnames a site has actually registered, which is why the settings entry and the DNS record both have to exist. Save the hostname before you point traffic at it.

## What changes, and what does not

The script sends its beacons to the origin it was loaded from, so serving it from `s.yourstartup.com` moves both the script download and the data collection onto your domain. Your site key, your reports and your cookies are unchanged: the visitor cookie was always first-party.

> **Watch out.** Update your [Content Security Policy](https://statsy.co/docs/tracking-script/csp) at the same time. A policy that only allows `https://statsy.co` will block the proxy host.

## Sending data somewhere else

The `data-proxy` attribute sets the origin beacons are posted to, independently of where the script file came from. Most sites do not need it: set the proxy host, change the `src`, and both follow.

Previous: [Tracking modes and cookieless](https://statsy.co/docs/tracking-script/tracking-modes)  
Next: [Single-page apps and route changes](https://statsy.co/docs/tracking-script/spa)