Introduction

Server-side tracking is often presented as a universal fix for:

The common belief is simple:

“If tracking runs on the server, browsers can’t interfere.”

This is incomplete.

Browsers do not block based on where your container runs.
They apply restrictions based on:

Server-side tracking is not a shield.
It is an architectural shift.

And architecture can be either resilient or fragile.


What “First-Party” Actually Means

Many teams assume:

“If the subdomain belongs to me, it’s first-party.”

Example:

sst.yourdomain.com  → CNAME → vendor.infrastructure.com

Technically:

Structurally:

This is known as DNS cloaking.

It appears first-party.
It is not architecturally first-party.

True first-party control is network-level control.


DNS Cloaking and ITP Detection

Safari’s Intelligent Tracking Prevention (ITP) checks the CNAME chain of the subdomain, and (since Safari 16.4) whether its IP address belongs to a different network than the main site (WebKit Tracking Prevention).

Example:

dig sst.yourdomain.com

If it returns:

sst.yourdomain.com CNAME vendor.example.net

Delegation is visible.

Consequence: cookies set by that subdomain’s HTTP responses are capped at 7 days.

DNS cloaking hides delegation.
It does not eliminate it.


What a Reverse Proxy Actually Changes

Without reverse proxy

Browser
   ↓
sst.yourdomain.com
   ↓ (CNAME)
vendor.infrastructure.com

With reverse proxy (Cloudflare proxied DNS)

Browser
   ↓
Cloudflare edge (sst.yourdomain.com)
   ↓
Vendor origin server

Caveat: since Safari 16.4, if sst.yourdomain.com resolves to IPs whose first half differs from www.yourdomain.com’s (e.g. the site is hosted elsewhere and only sst. is on Cloudflare), Safari still caps its cookies at 7 days (WebKit bug 246477). Same-origin serving (www.yourdomain.com/metrics) or putting the main site behind the same edge avoids this.

Now:

This is a structural difference.


TLS Termination and Trust Chain

With a proxied DNS setup:

The TLS handshake occurs between:

Browser ↔ Cloudflare

Not:

Browser ↔ Vendor infrastructure

TLS terminates at your edge. This gives you control over headers and routing; it is not, by itself, what Safari checks (Safari checks CNAME and IP).


Server-Generated Cookies: The Real Test

A resilient setup must generate cookies server-side.

Example header (SameSite=Lax is enough for a first-party measurement cookie; None is only for cross-site use, see MDN Set-Cookie):

Set-Cookie: fp_id=abc123;
Domain=.yourdomain.com;
Secure;
HttpOnly;
SameSite=Lax;
Path=/;

How to validate

Step 1 — Browser inspection

Open DevTools → Network → click a request to:

https://sst.yourdomain.com

Inspect Response Headers.

Look for:

Set-Cookie:

If absent → no server-generated cookie.


Step 2 — CLI verification

curl -I https://sst.yourdomain.com

Expected (if you use Cloudflare):

server: cloudflare

Expected if you use Cloudflare. With another CDN or load balancer, check that the IPs returned by dig sst.yourdomain.com and dig www.yourdomain.com share the same first half.

If no Set-Cookie → architecture is incomplete.

Without server-generated cookies, there is nothing to restore. Google’s recommended set-up is same origin (www.yourdomain.com/metrics), which also avoids Safari’s IP check (Google: custom domain for server-side tagging).


Serving the Loader First-Party

Default loader:

https://www.googletagmanager.com/gtm.js

First-party loader:

https://sst.yourdomain.com/gtm.js

Benefits:

This does not change consent obligations (Google tag gateway, CNIL). If the loader remains third-party, part of your tracking remains exposed.


Building an Omniscient Reverse Proxy (Cloudflare Worker)

A programmable reverse proxy allows:

Minimal example:

export default {
  async fetch(request) {
    const url = new URL(request.url);
    url.hostname = "vendor.origin.net";

    const modifiedRequest = new Request(url, request);
    return fetch(modifiedRequest);
  }
}

This enables:

But requires:

This is an architectural decision, not a quick win.


Architecture Models Compared

ModelComplexityControlSafari 7-day cap risk
CNAME to vendorLowLowYes
Managed reverse proxyMediumMediumYes, if on a different IP range than the main site
Custom Worker proxyHighVery HighYes, if on a different IP range than the main site
Same-origin path (www.yourdomain.com/metrics)——No

The correct choice depends on:


Practical Audit Checklist

To assess your setup:

If not, your server-side setup may not be structurally resilient.


Conclusion

Server-side tracking is not a feature.

It is network architecture.

The difference between:

“Works today”
and
“Resilient tomorrow”

is not the container.

It is:

DNS
TLS
Headers
Cookies
Proxy design

Resilient tracking systems are designed — not installed.

Related reading

Not sure your own tracking is right?

Book a call Or start with the free analytics audit →