Server-Side Tracking for Marketers: GA4, Consent and Why Your Data Is Wrong

If your GA4 numbers never quite match your ad platforms, your CRM or your bank account, you're not imagining it. Browsers block scripts, cookies expire early and people say no to cookie banners.
Server-side tracking sends your measurement data through a server you control before it reaches Google Analytics, Google Ads or Meta, instead of straight from the visitor's browser. It can fix some of the data loss. It does not get you out of asking for consent. This guide explains both, in plain English.
And before you treat your CRM as the "true" number, a word of warning. CRMs are often human dependent. Someone picks a lead source from a dropdown, or interprets where a lead came from, so the CRM can end up wrong or different from what actually happened. GA4 under-counts, the CRM mis-labels, and the truth usually sits somewhere in between.
Why is your GA4 data wrong?
GA4 under-counts because ad blockers stop tags loading, Safari shortens cookie life, and visitors who decline consent aren't fully measured. Each of these chips away at your numbers.
Short cookie life in Safari. Apple's WebKit team capped cookies created by JavaScript to seven days back in 2019. So a returning Safari visitor after day eight can look like a brand-new user.
Blocked scripts. Browser extensions and some privacy settings stop analytics scripts loading at all.
Consent choices. In the UK, visitors who reject cookies shouldn't be tracked the normal way, so they drop out or get modelled.
None of this means GA4 is broken. It means GA4 is measuring a smaller slice of reality than you think.
What is server-side tracking?
Server-side tracking adds a second step: the browser sends one stream of data to your own tagging server, which then forwards it to each tool. In Google's setup, this is a server container in Google Tag Manager.
Google's documentation describes a server container as an application that processes data on a server you control, rather than in the user's browser. You still keep a web container or the Google tag on your site. It just sends data to your server instead of directly to every vendor.

Client-side vs server-side tracking: what changes?
With server-side tracking you control what data leaves your site, the page loads fewer third-party scripts, and cookies can be set in a first-party context. Here's the side-by-side.
Client-side | Server-side | |
Where tags run | In the visitor's browser | On your tagging server |
Who sees raw data first | Each vendor | You |
Can you strip or edit data before sending? | Hard | Yes |
Page speed impact | More scripts on the page | Fewer scripts on the page |
Running cost | Free | You pay for hosting |
Consent still needed? | Yes | Yes |
Google lists three reasons to use it: improving privacy controls, improving page performance and improving data quality. Running in a first-party context also means cookies can be set with the HttpOnly flag, which makes them more durable and more secure.
Does server-side tracking get around cookie consent?
No. Moving tags to a server does not change the rules on collecting data, so you still need consent where the law requires it. As the consent platform iubenda puts it plainly, consent still applies.
This is where I see the most confusion. Some sellers pitch server-side tracking as a way to "recover" data from people who said no. If someone rejects cookies and you track them anyway, that's a compliance problem, not a clever workaround.
What has changed in the UK is narrower. The Data (Use and Access) Act 2025 added a consent exemption for some analytics. According to CookieYes' summary of the ICO's finalised 2026 cookie guidance, analytics for statistical purposes may be exempt, and a third-party analytics tool only qualifies if it acts purely on your behalf. Law firm Bates Wells notes that the exemption doesn't apply to online advertising or tracking users.
So: aggregate stats about your own site may not need consent. Ads, remarketing and conversion tracking still do. Get proper advice for your setup. I'm a marketer, not a lawyer.
How does Google Consent Mode fit in?
Consent Mode passes each visitor's cookie choice to Google tags, so they adjust what they collect. Google has required Consent Mode v2 for advertisers using its ad products with UK and EEA traffic since March 2024, alongside a Google-certified consent platform.
There are two versions. In basic mode, tags don't load until the visitor interacts with the banner. In advanced mode, tags send cookieless pings when people decline, which Google uses for conversion modelling.
Server-side tracking and Consent Mode work together. One doesn't replace the other.
How do you set up server-side tracking?
Create a server container in Google Tag Manager, host it, point a subdomain of your site at it, then route your GA4 tag through it. The short version:
Create a server container in Google Tag Manager.
Host the tagging server. Google offers automatic provisioning on Google Cloud Run, or you can use a managed host such as Stape.
Use your own subdomain, for example metrics.yoursite.co.uk, so data flows in a first-party context.
Send GA4 data to the server by adding your server container URL to the Google tag.
Add server tags for GA4, Google Ads and Meta's Conversions API.
Keep Consent Mode connected, so consent choices pass through to the server.
Test in preview mode before publishing.
Google also offers a lighter option called Google tag gateway for advertisers, which loads Google's scripts from your own domain.
I haven't set this up on my own blog, because a small Wix blog with no ad spend doesn't need it (more on that below). So here's an illustrative example of how it plays out.
Example (illustrative): a UK online shop runs Google Ads and Meta ads. A shopper clicks an ad on their iPhone, browses, then comes back nine days later to buy. Client-side, Safari has already expired the JavaScript cookie, so GA4 sees a new visitor and the ad gets no credit. With a server container on metrics.theirshop.co.uk, the visitor ID can be set by the server as a first-party cookie, so the return visit is more likely to be linked to the original ad click. That only applies if the shopper accepted cookies in the first place.
Is server-side tracking worth it?
It's worth it if you spend meaningfully on ads, rely on conversion data for bidding, or get lots of Safari traffic. For a small blog or brochure site with no ad spend, it's probably more cost and maintenance than it's worth.
My take: fix the basics first. A properly configured consent banner, Consent Mode and clean GA4 events will do more for most small teams than a server container set up badly. Then add server-side when your ad spend justifies the hosting bill.
FAQ
Does server-side tracking stop ad blockers?
It can reduce blocking because requests go to your own domain, but it doesn't guarantee every visitor is measured. And it shouldn't be used to track people who opted out.
Is server-side tracking GDPR compliant?
It can be, if consent and data processing are handled properly. The server gives you more control to strip personal data before it's sent on.
Does Wix support server-side tracking?
Check your site's integrations carefully. Wix runs its own tracking setup, so talk to a developer before adding a server container to a Wix site.
Related reading
About the author
Faryal Raza Bhatti is a UK marketer based in Birmingham, trained as a software engineer before moving into marketing. He writes about AI, search and paid media the way he'd explain it to a friend. Connect on LinkedIn.





Comments