How to Track Your Website Traffic While Remaining (Relatively) Compliant with GDPR
Let’s be honest about something that most marketing blogs won’t say out loud.
If you run paid advertising and follow GDPR cookie consent rules to the absolute letter, your ad platforms will be partially blind. Google Ads won’t see a significant chunk of your conversions. Bing won’t know who bought from you. Your retargeting audiences will shrink. Your cost-per-acquisition will rise — not because your ads got worse, but because the data that proves they’re working has gone dark.
This is the reality of running a commercial website in a post-GDPR world. And it’s a reality that most businesses are navigating badly — either ignoring consent entirely (a genuine legal risk) or implementing it so strictly that they cripple their own advertising performance.
There is a middle ground. It’s grey. It requires some technical sophistication. But it exists, and it’s where most commercially pragmatic businesses should be operating.
This article explains the options, the trade-offs, and how to set it up properly.
The Problem: What Happens When Users Decline Cookies
When a user lands on your site and your cookie consent banner appears, one of three things happens:
- They accept — your analytics and ad tags fire normally, cookies are set, conversions are tracked, and your ad platforms learn from the data.
- They decline — if you’ve implemented consent correctly, your tracking tags don’t fire, no cookies are set, and that visitor becomes invisible to your analytics and advertising platforms.
- They ignore the banner — depending on your implementation, this is treated as either implicit decline (strict) or no action taken (tags may or may not fire, depending on your default consent state).
The decline rate varies by industry, geography, and how your consent banner is designed, but a typical range is 30–50% of visitors declining or ignoring the banner. On some sites it’s higher.
That means up to half of your traffic — including people who click your ads, browse your products, and complete purchases — is invisible to Google Ads and Microsoft Advertising.
The Ad Blocker Problem (On Top of Consent)
Cookie consent isn’t the only thing eating your data. Ad blockers actively strip tracking scripts from your pages before they ever execute.
uBlock Origin, AdBlock Plus, Brave’s built-in shields, Firefox Enhanced Tracking Protection, Safari’s Intelligent Tracking Prevention — they all maintain blocklists of known tracking domains. When your page tries to load google-analytics.com/analytics.js or bat.bing.com/bat.js, the ad blocker intercepts the request and kills it. The script never loads. The tag never fires. The visitor is completely invisible — regardless of whether they consented to cookies or not.
Ad blocker usage varies, but industry estimates put it at 25–40% of desktop users in most Western markets. On tech-savvy audiences it’s higher. Among younger demographics it’s the norm.
Here’s the critical point: ad blockers and cookie consent are separate problems, and they stack. A visitor might accept your cookies but still run an ad blocker — their consent is irrelevant because the tracking script was blocked before it could execute. Combine 35% ad blocker usage with 35% cookie decline rates and you can easily lose 50–60% of your total conversion visibility before you even consider mobile browser restrictions.
Standard client-side tracking — loading scripts from googletagmanager.com, google-analytics.com, bat.bing.com — is trivially blocked because the domains are on every blocklist in existence. This is one of the strongest arguments for first-party tracking infrastructure, which we’ll cover in the solutions section. When your tracking loads from yourdomain.com/collect instead of google-analytics.com/collect, ad blockers can’t distinguish it from your own site’s functionality without breaking your site entirely.
This isn’t a hack or an exploit. Google explicitly supports first-party deployment via server-side GTM and Cloudflare’s Google Tag Gateway. These are sanctioned, documented deployment methods. The tracking endpoints live on your domain, requests are first-party, and blocklists can’t target them without blocking your entire site.
Is this circumventing the intent of ad blockers? Arguably, yes. Users installed a blocker because they don’t want to be tracked. But unlike ignoring cookie consent — which has clear legal consequences — serving first-party tracking scripts isn’t illegal. There’s no regulation that says your website must be compatible with third-party browser extensions. It’s a grey area, and a much lighter shade of grey than most of the consent-related techniques.
What This Does to Your PPC
Ad platforms rely on conversion data to optimise. Google Ads uses your conversion history to decide which searches to bid on, which audiences to target, and how much to spend. Microsoft Advertising does the same. This is “machine learning” in the practical sense — the algorithm learns what a converting visitor looks like and finds more of them.
When you cut 30–50% of your conversion data, the algorithm can’t learn properly. It’s trying to optimise a campaign while blind to a third of its results. The consequences are real:
- Smart Bidding underperforms — Target CPA and Target ROAS strategies need conversion volume to work. Less data means worse bidding decisions.
- Audience signals degrade — remarketing lists shrink because you can’t cookie visitors who declined consent.
- Attribution breaks — multi-touch attribution models can’t track the customer journey if the tracking tags never fired on the first visit.
- Reported ROAS drops — not because your ads stopped working, but because you stopped being able to measure them.
We saw this firsthand on a client site recently. When tracking tags moved from firing unconditionally to being gated behind a consent banner, reported return on ad spend dropped from 140% to 72% overnight. The ads hadn’t changed. The landing pages hadn’t changed. Customer behaviour hadn’t changed. The only thing that changed was that a large portion of conversions became invisible to the ad platforms.
The Compliance Spectrum
Not all tracking setups are equal from a compliance perspective. Here’s the spectrum, from strictest to most aggressive:
Definitely Compliant (But Commercially Painful)
- Cookie consent banner blocks ALL tags until explicit consent is granted
- Default consent state for all storage types is “denied”
- No cookies, no local storage, no fingerprinting, no tracking of any kind until the user clicks “Accept”
- Analytics platforms see only consenting users
- Ad platforms lose 30–50% of their data
This is what the most conservative reading of GDPR requires. If your legal team is risk-averse, this is where you’ll land. Your compliance is bulletproof. Your ad performance will suffer.
The Grey Zone (Where Most Businesses Should Be)
- Consent Mode v2 enabled — tags load in a restricted “cookieless” state before consent, then upgrade to full tracking after consent is granted
- No cookies or personal data stored before consent
- Ad platforms use modelled conversions to fill the gap — Google and Microsoft use machine learning to estimate the conversions they can’t directly observe
- Server-side tagging routes data through your own infrastructure rather than directly to third-party servers
- First-party domain proxying via Cloudflare serves tracking scripts from your domain rather than from
googletagmanager.com
This is the grey zone because:
- You ARE loading tracking scripts before consent (they just don’t store cookies)
- The scripts DO send cookieless pings to Google/Microsoft (without personal data)
- Google’s modelling DOES estimate conversions that weren’t directly measured
- Some privacy advocates argue this violates the spirit of GDPR, even if no cookies are set
But Google explicitly designed Consent Mode to be GDPR-compatible. The ICO (UK) and CNIL (France) have not prohibited it. And the practical benefit is significant — you maintain 70–90% of your conversion data accuracy through modelling, while respecting user consent choices.
Definitely Non-Compliant (Don’t Do This)
- Tracking tags fire before the consent banner even loads
- “Accept All” is pre-selected or visually dominant to trick users into consenting
- The consent banner is implemented but doesn’t actually block tags when users decline (a “cosmetic” consent banner)
- User data is collected and stored regardless of consent choices
- Dark patterns that make it harder to decline than to accept (burying the “reject” option behind multiple clicks)
These approaches are what regulators actively pursue. Fines under GDPR can reach 4% of global annual turnover. It’s not worth the risk.
The Technical Setup: How to Do It Right(ish)
1. Google Consent Mode v2
Consent Mode is Google’s answer to the GDPR data gap. Here’s how it works:
When a user hasn’t yet consented (or has declined), your Google tags fire in a restricted mode. They send cookieless, anonymised pings to Google — enough for Google to know “someone visited this page” and “someone completed a purchase,” but without setting cookies or collecting personal identifiers.
Google then uses these restricted pings, combined with data from consenting users, to model the conversions it couldn’t directly observe. If 60% of your users consent and Google can see their full journey, it uses that data to statistically estimate what the other 40% did.
The setup requires:
In your consent banner (CookieHub, Cookiebot, OneTrust, etc.):
- Map your consent categories to Google’s consent types:
- Marketing/Advertising consent maps to
ad_storage,ad_user_data,ad_personalization - Analytics consent maps to
analytics_storage
- Marketing/Advertising consent maps to
- Set default consent state to “denied” for all types — this is critical for compliance
- When a user consents, the banner updates the consent state and Google’s tags automatically upgrade to full tracking
In Google Tag Manager:
- Enable Consent Mode in your Google tags (GA4, Google Ads)
- Configure tags to respect consent signals
- The Conversion Linker tag should fire on all pages but will only set cookies when
ad_storageis granted
In Google Ads:
- Enable “Enhanced conversions” — this allows Google to use hashed first-party data (email addresses from checkout) to improve conversion matching
- Enable “Consent Mode modelling” in your conversion settings
- Allow time for the modelling to calibrate — Google needs a baseline of consented data before it can accurately model the rest
Microsoft/Bing Advertising has a similar “Consent Mode” for UET tags. Configure it the same way.
2. Server-Side Google Tag Manager
Standard GTM loads a JavaScript container in the user’s browser. Every tag fires from the browser, sends data directly to third-party servers (Google, Microsoft, Facebook, etc.), and is subject to ad blockers, browser privacy features, and consent restrictions.
Server-Side GTM (sGTM) adds a middle layer. Instead of the browser sending data to dozens of third-party endpoints, it sends data to your own server, which then forwards it to the ad platforms.
How it works:
- You deploy a server-side GTM container on Google Cloud Run (Google’s cloud hosting platform)
- Your website sends tracking data to your own subdomain (e.g.,
data.yourdomain.com) - Your server-side container processes the data and forwards it to Google Analytics, Google Ads, Microsoft Advertising, etc.
- From the browser’s perspective, data only goes to your domain — first-party context
Why this matters:
- Ad blockers can’t block it — the requests go to your own domain, not to
google-analytics.comorbat.bing.com. This alone can recover 25–40% of desktop visitors that were previously invisible. The blocklists target known third-party tracking domains — when your tracking runs throughdata.yourdomain.com, there’s nothing to block. - Browser privacy features are less aggressive — Safari’s ITP and Firefox’s Enhanced Tracking Protection target third-party domains. First-party requests aren’t affected.
- You control the data — your server decides what gets forwarded and what gets stripped before it reaches Google or Microsoft. You can enforce consent server-side too, ensuring that even if a client-side check is bypassed, personal data is only forwarded when consent was genuinely granted.
- Cookies set server-side have longer lifespans — first-party cookies set via HTTP headers aren’t subject to the browser’s 7-day cap on JavaScript-set cookies (Safari ITP). A Google Ads click ID (
gclid) stored in a first-party server-side cookie lasts the full 90 days instead of expiring after a week — meaning conversions that happen weeks after the initial click are still attributed correctly.
The compliance angle: Server-side tagging doesn’t bypass consent. You still need consent to store cookies and process personal data. But it makes your consented tracking more accurate (longer cookie lifespans, no ad blocker interference) and your Consent Mode modelling more effective (more baseline data for Google to model from).
Cost: Google Cloud Run charges based on usage. For most small to medium sites, expect around £50–150/month. High-traffic sites with heavy tag stacks can be more.
3. Cloudflare as a First-Party Proxy
If you’re already using Cloudflare (and you probably should be), you have a simpler option for first-party tracking that doesn’t require Google Cloud.
Cloudflare Google Tag Gateway serves Google’s tracking scripts from your own domain. Instead of loading googletagmanager.com/gtag/js, the browser loads /2adq/ (or a similar path) from your site. Cloudflare handles the proxying transparently.
What this achieves:
- Google’s tag loads as a first-party script — harder for ad blockers to detect
- Data is proxied through Cloudflare’s network rather than going directly to Google
- Reduces the number of third-party connections (good for performance too)
Cloudflare Zaraz goes further — it’s a full tag management system built into Cloudflare that can replace or supplement GTM. It executes tags at the edge (on Cloudflare’s servers) rather than in the browser, reducing client-side JavaScript and improving page speed.
The grey area: Proxying Google’s tracking through your own domain is technically serving a third-party service under a first-party disguise. Privacy advocates argue this undermines users’ ability to control tracking through browser settings and extensions. Regulators haven’t specifically ruled on this, but it’s worth being aware that this technique pushes the boundaries.
We saw this exact setup on a client site — Cloudflare’s Google Tag Gateway was proxying a GA4 property through a /2adq/ endpoint on their domain. It worked, but it was feeding a GA4 property that nobody was monitoring. The lesson: these tools are powerful, but they need to be configured deliberately and audited regularly.
Real-World Numbers: How Much Data Are You Actually Losing?
On the client site we referenced earlier, here’s what happened when tracking moved from unconditional (hardcoded scripts, no consent gating) to consent-gated (GTM only, CookieHub managing consent):
- Reported ROAS dropped from ~140% to ~72% — a 49% reduction in reported return
- The actual business revenue hadn’t changed — orders were still coming in at the same rate
- The gap was entirely measurement loss — conversions that happened but weren’t attributed to the ad platforms
This gives you a rough sense of the scale: on this particular site, approximately half of all conversions were from users who either declined cookies or didn’t interact with the consent banner. Those conversions still happened — the business still got paid — but Google Ads and Microsoft Advertising couldn’t see them, couldn’t learn from them, and couldn’t optimise toward them.
With Consent Mode v2 properly configured, Google claims to recover 70–80% of those lost conversions through modelling. Combined with server-side tagging and enhanced conversions, you can realistically get to 85–95% conversion data accuracy — even with full consent compliance.
The difference between “half your data is missing” and “5–15% of your data is modelled” is the difference between crippled ad performance and a well-optimised campaign.
What You Should Actually Do
Here’s the practical playbook, ordered from least to most technically complex:
Minimum
- Implement Consent Mode v2 in your existing GTM setup with your existing consent banner
- Set default consent to “denied” for all storage types
- Enable modelled conversions in Google Ads
- Enable Microsoft Consent Mode for Bing UET tags
This is the baseline. It costs nothing, takes a few hours to configure, and immediately recovers a significant portion of your lost conversion data through modelling.
Intermediate
- Enable Enhanced Conversions in Google Ads — hash and send customer email addresses from your checkout to improve conversion matching
- Configure Cloudflare Google Tag Gateway — serve Google’s tags from your domain for first-party context
- Audit your GTM container — remove dead tags, consolidate duplicates, ensure all tags respect consent signals
- Remove hardcoded tracking scripts — everything should route through GTM so consent is managed in one place
Advanced
- Deploy Server-Side GTM on Google Cloud Run with your own subdomain
- Route all tracking through the server-side container — GA4, Google Ads, Microsoft Advertising
- Configure server-side consent enforcement — strip personal data server-side when consent isn’t granted
- Set up first-party cookie management — server-side cookies that survive Safari ITP’s 7-day limit
- Monitor and tune — compare consented vs modelled conversion volumes, adjust bidding strategies accordingly
Where the Line Is
Let’s be clear about what’s acceptable and what isn’t:
Acceptable (grey but defensible):
- Loading tracking scripts in cookieless mode before consent (Consent Mode v2)
- Using Google’s modelled conversions to estimate unobserved conversions
- Serving tracking scripts from your own domain via Cloudflare or similar proxy
- Setting first-party cookies server-side for longer lifespans
- Using hashed email data for enhanced conversion matching
Not acceptable (clear violations):
- Ignoring consent choices entirely
- Storing cookies or personal data before consent is granted
- Using dark patterns to manipulate consent rates
- Fingerprinting users who declined cookies
- Sharing personal data (including IP addresses) with third parties like Google without consent
- Running a cosmetic consent banner that doesn’t actually control tag firing
The grey zone exists because the law was written broadly and technology has evolved faster than enforcement. Consent Mode, server-side tagging, and first-party proxying are all techniques that operate in the space between what the regulation literally prohibits (storing personal data without consent) and what privacy advocates wish it prohibited (any form of tracking, period).
As a business, you need to decide where on that spectrum you’re comfortable operating. Our advice: implement Consent Mode v2 and server-side tagging. They’re designed to balance user privacy with business measurement needs. They’re endorsed (or at least not prohibited) by the major data protection authorities. And they give your ad platforms enough data to optimise effectively.
The Bottom Line
You don’t have to choose between GDPR compliance and effective advertising. But you do need a more sophisticated setup than “install a consent banner and hope for the best.”
The businesses that win in this environment are the ones that invest in proper tracking infrastructure — Consent Mode, server-side tagging, first-party data strategies, and regular auditing of their analytics stack. They lose less data, their ad platforms learn faster, and they make better decisions because they can actually measure what’s happening.
The businesses that lose are the ones that either ignore consent (and risk regulatory action) or implement it naively (and starve their ad platforms of the data they need to perform).
Need a Bespoke Tracking Setup?
Every site is different. Your consent rates, your ad platform mix, your tech stack, your risk tolerance — they’re all unique to your business. We build bespoke analytics and tracking architectures for businesses that take both compliance and performance seriously.
We’ve configured Consent Mode v2 implementations, deployed server-side GTM containers, audited GTM tag stacks, set up Cloudflare proxying, and recovered tens of thousands of pounds in previously invisible conversion data for our clients.