What is server-side tracking?
Client-side tracking runs JavaScript in the visitor's browser. Server-side tracking runs on your own server and forwards data to platforms such as GA4, Meta and Google Ads, server to server. It is less exposed to ad blockers and ITP, gives you control over what data is sent, and can improve page speed.
Why you need it
- Ad blockers block client-side tags in 40%+ of desktop sessions.
- Safari ITP deletes JavaScript-set cookies after 7 days, while server-set cookies can last up to 400 days.
- Firefox ETP blocks known tracking domains by default.
- iOS ATT sharply limits mobile attribution.
- GDPR calls for better control over what data leaves your server.
Server-side GTM (sGTM)
The most common setup is server-side Google Tag Manager on Google Cloud Run. A first-party subdomain proxies requests through your server to Google, Meta and other platforms. Because the subdomain belongs to your domain, ad blockers do not treat it as an external tracking domain.
Meta Conversions API
Meta's server-side option sends conversion data straight from your server to Meta. Running it alongside the pixel improves event matching and lowers cost per acquisition.
Cloudflare Workers as an alternative
For simpler setups, or when Google Cloud costs are a barrier, Cloudflare Workers run on edge nodes worldwide, are very fast and cost very little at normal traffic.
What server-side tracking does not solve
It does not remove consent requirements. You still need a CMP and Consent Mode v2. What it does give you is the ability to anonymize or aggregate data before forwarding it.
Frequently asked questions
What does server-side GTM cost?
Cloud Run typically costs about 10 to 50 SEK per month for normal traffic. Stape.io is an alternative with a flat monthly fee.
Does it recover all lost data?
No. It recovers data lost to ad blockers and ITP. Data lost to declined consent is handled by Consent Mode v2 and conversion modeling.
Do I need it?
Probably, if you spend over 20,000 SEK per month on paid ads and Safari and Firefox make up more than 25% of your traffic. Below that, a clean client-side setup with Consent Mode v2 is often enough.
Is it GDPR-compliant?
It often gives better control than client-side, since you decide exactly what is sent and can anonymize IP addresses before data leaves your server.