Skip to content
Tracking and technical

What is a first-party analytics proxy?

3 min read · Updated · By the Reveata team

Short answerA first-party analytics proxy routes the analytics script and the events it sends through an address on your own domain, such as stats.example.com or /dt/event, so the browser sees them as part of your site instead of a request to another company.

A stack of cardboard shipping boxes inside the back of a delivery van
Photo by Claudio Schwarz on Unsplash

By default an analytics script loads from the provider's domain and sends events back there. Browsers, privacy tools and ad blockers recognise those addresses. A proxy puts a hop on your side in between: the browser asks your domain for the script, and your domain fetches it from the provider and passes it on. Events travel the same way in reverse.

Two ways to proxy

DNS proxy (subdomain) Server proxy (path)
Address the browser sees stats.example.com example.com/dt/script.js
What you change One DNS record Rewrite rules on a server or edge platform
Who runs the hop The analytics provider You
Needs code No A few lines of config

What a proxy changes and what it doesn't

It changes the address. Scripts served from your own site are blocked far less often, and a Content Security Policy only needs 'self' when everything goes through your domain.

It does not change what is collected. The same script runs and sends the same data. Your privacy notice, legal basis and any consent you need stay the same.

Reveata's managed proxy

Pick an unused subdomain in Settings → General → Managed proxy, such as stats, and add the CNAME record Reveata shows at your DNS provider. Reveata checks the record, sets up HTTPS for the subdomain on its own and gives you a new snippet that loads from it (Managed proxy):

html
<script defer data-website-id="ws_your_tracking_id" src="https://stats.example.com/js/script.js"></script>

DNS changes usually show within minutes. Reveata checks every 10 minutes for 3 days, then daily while you use it, and emails the owner if the record stops pointing to it for 3 days. On Cloudflare, set the record to DNS only (grey cloud), or Reveata cannot verify it. Avoid subdomain names like analytics or tracking, which some blockers look for.

Your own server as the proxy

Without a DNS record, you can pass two addresses through Next.js, Vercel, Netlify, Cloudflare Workers, Nginx, Caddy, Apache, Express, Laravel or WordPress: the script (GET) and the event endpoint (POST), then point the snippet at them with data-api (Proxy through your own server).

A server proxy has one extra job: telling Reveata the visitor's real IP address. Otherwise every visit looks as if it came from your server. Create a proxy secret (it starts with dt_proxy_), keep it in an environment variable, and send it in X-Reveata-Proxy-Secret with the visitor's address in X-Reveata-Client-IP. Only with a valid secret does Reveata use that address for location, IP exclusions, cookieless counting and rate limits. Pass on the browser's headers, never your cookies, and never cache the event path.

Pitfalls

  • Losing the visitor's address. Without the proxy secret, locations and IP exclusions use your server's address.
  • Dropping headers. A proxy that strips User-Agent, Accept-Language or fetch metadata makes real visits look scripted, and they are dropped as suspected bots.
  • Leaking secrets. The proxy secret belongs on the server only. Rotate it if it leaks.
  • Crawler verification. Behind your own proxy without the secret, real crawlers can look spoofed because Reveata only sees your proxy's address.

Frequently asked questions

Is a first-party proxy the same as server-side tracking?

Not quite. The proxy still relays events created by the script in the browser. Server-side tracking creates events in your backend. Many sites use both.

Does a proxy make analytics cookies first-party?

Reveata's cookies are already first-party, set on your own domain by the script. The proxy changes where the script and events are loaded from and sent to, not which domain owns the cookies.

Which should I choose, managed or my own?

The managed proxy needs only a DNS record and no maintenance. Your own proxy suits teams who cannot add DNS records or want every request to pass through infrastructure they control.

See it with your own numbersReveata ties every visit and sale to the source that brought it. Add your website in a minute.
Get started
Was this page useful?
GlossaryWhat is an ad blocker and how does it affect analytics?An ad blocker is a browser extension, browser feature or network filter that stops ads and often tracking scripts from loading, which means analytics tools can miss visits from people who use one.GlossaryWhat is server-side tracking?Server-side tracking means your backend, not the visitor's browser, sends events such as sign-ups, payments or page requests to your analytics tool, so they are recorded even when a script is blocked or never runs.GlossaryWhat is a Content Security Policy (CSP)?A Content Security Policy (CSP) is a set of rules a website sends to the browser, usually in a Content-Security-Policy header, listing which sources of scripts, styles, images and network connections the page is allowed to use, so injected or unexpected code is blocked.GlossaryWhat are Core Web Vitals?Core Web Vitals are three measurements Google uses to describe a page's real-world user experience, namely Largest Contentful Paint (loading), Interaction to Next Paint (responsiveness) and Cumulative Layout Shift (visual stability).GlossaryWhat are event properties?Event properties are key–value details attached to an analytics event, such as the plan chosen or the button clicked on a signup event, so you can break one event down by those details instead of creating a separate event for every variation.GlossaryWhat is a canonical URL?A canonical URL is the one preferred address you want search engines to index and show for a page whose content is reachable at several URLs, usually declared with a rel="canonical" link in the page's head.