GA4 & Tracking

Consent Mode v2 with Server-Side GTM and Meta CAPI: How It Works

Server-side tracking does not remove the need for consent. Here is how consent signals reach your server container and how to make every server tag respect them.

Quick answer

Consent Mode v2 signals travel from your cookie banner, through the web container, to server-side GTM inside each GA4 request. Google tags in the server container read them automatically. Meta CAPI, TikTok and other server tags do not, so you must add consent checks to their triggers. Server-side tracking makes data more reliable, but it never replaces consent.

Key takeaways
  • Server-side tracking moves where tags run; it does not change what you need consent for.
  • Consent state reaches the server container inside the GA4 request.
  • Google tags in the server container respect consent automatically.
  • Non-Google server tags, such as Meta CAPI, need explicit consent conditions.
  • Test both accepted and declined consent before going live.

A common belief I hear is that server-side tracking "gets around" cookie banners. It does not. Server-side GTM changes where your tags run, not what your visitors agreed to. What it does change is how consent has to be handled, because some server tags understand consent automatically and others ignore it completely. This guide explains the full path from the banner to the server and how to make every tag follow it.

If you are new to Consent Mode itself, read Consent Mode v2 explained first.

Consent travels with each event, inside the request the web container sends to your server.

  1. The visitor makes a choice in your cookie banner (CMP).
  2. The CMP updates Google Consent Mode v2: ad_storage, analytics_storage, ad_user_data and ad_personalization.
  3. The Google tag in your web container sends GA4 events to your server container, and adds the consent state to each request as encoded parameters (gcs, and in newer requests gcd).
  4. The server container's GA4 client reads the request, including the consent state, and passes it to the tags that run on that event.

The server never sees the banner. It only knows what each request tells it, so if the web side does not set consent correctly, the server cannot fix it.

Google's own server tags do; most others do not.

Server tag Reads Google consent automatically? What you need to do
GA4 Yes Make sure Consent Mode is set on the web side
Google Ads conversion / remarketing Yes Same as above; check ad_user_data for enhanced conversions
Meta Conversions API No Add a consent condition to the trigger
TikTok Events API No Add a consent condition to the trigger
Pinterest, Snapchat, LinkedIn CAPI No Add a consent condition to the trigger
Custom webhooks / CRM No Decide per purpose and add conditions

You give the server container a clear consent value and use it in the trigger.

  1. Send the consent state with each event. Many setups parse the gcs value in the server container with a variable template. Alternatively, add an event parameter such as consent_marketing: granted or denied in the web container, set from your CMP.
  2. Create a server variable that returns the marketing consent state for the current event.
  3. Add a condition to the Meta CAPI trigger: fire only when marketing consent equals granted.
  4. Repeat for TikTok, Pinterest and any other advertising tag.

If your Meta Pixel also respects consent in the browser, the browser and server sides now follow the same rule, and deduplication still works for visitors who accept.

What happens when a visitor declines?

With advanced Consent Mode, Google tags still send cookieless pings when consent is denied. These do not store or read cookies, but let Google model conversions for visitors who declined. In the server container:

  • GA4 and Google Ads tags receive these pings and handle them according to the consent state.
  • Meta and other non-Google tags should not fire for advertising when marketing consent is denied.

If you use basic Consent Mode, nothing is sent until the visitor accepts, so the server container simply receives fewer events.

Yes. Strict opt-in is required for visitors in the EEA, UK and Switzerland. Many US states use opt-out rules instead, and other countries vary. Most CMPs can set different defaults by region, for example denied in Europe and granted elsewhere. Your server container just follows whatever state arrives with each event, which is why getting the web side right matters most.

Test both choices before you go live:

  • Decline all in the banner, then trigger a purchase or lead
  • In server GTM Preview, confirm the GA4 request shows denied consent and Meta CAPI does not fire
  • Accept all, repeat the action, and confirm every tag fires with full data
  • Check that consent updates apply without a page reload, if your CMP supports it
  • Confirm no tag in the web container fires before the consent default is set

The free Tracking Checker shows whether a cookie banner and a Consent Mode default are present on your site, which is a quick first check.

Final thoughts

Server-side GTM and Consent Mode work well together, as long as you remember that only Google's tags understand consent on their own. Pass a clear consent value to the server, add it to every non-Google tag, and test both choices. If you want your consent and server-side setup checked, see my conversion tracking service or book a free audit.

Related
Chamok Mahonto
Written by Chamok Mahonto

I'm a conversion tracking & google ads specialist from Rangpur, Bangladesh. I set up GA4, GTM, server-side tracking and Meta Conversion API, and manage Google Ads for businesses worldwide. More about me

FAQ

Frequently asked questions

Does server-side tracking let me ignore cookie consent?

No. Sending data from a server instead of the browser does not change your legal obligations. If a visitor declines marketing cookies, your server tags should not send their data for advertising.

Do I still need Consent Mode if I use server-side GTM?

Yes. Consent Mode is how your banner's choice reaches Google tags, including the ones in your server container. Without it, the server container cannot tell what the visitor agreed to.

How does Meta CAPI know about consent?

It does not know by itself. You pass the consent state to the server container with each event and block or limit the Meta tag when marketing consent is denied.

What is the gcs parameter?

It is a parameter Google adds to GA4 requests that encodes the current consent state. Newer requests also carry a gcd parameter with more detail. Server-side Google tags read these values.

Keep reading

Related articles

GA4 & Tracking

How to Set Up BigCommerce Tracking for GA4, Google Ads and Meta

BigCommerce offers native integrations and Script Manager. Here is how to combine them without double-counting purchases in GA4, Google Ads and Meta.

4 min read · November 2, 2026
GA4 & Tracking

Consent Mode v2 Explained: What Small Businesses Must Do

A plain-English guide to Google Consent Mode v2: the four signals, basic vs advanced mode, who needs it, and how to set it up and test it in GTM.

6 min read · October 30, 2026
GA4 & Tracking

GA4 Cross-Domain Tracking: Setup, Testing and Common Failures

When GA4 cross-domain tracking is needed, how to configure your domains and the _gl linker, handle iframes and payment gateways, and fix what breaks it.

7 min read · October 31, 2026

Ready to fix your tracking and scale your ads?

Get a free audit of your tracking and ad account. Usually replies within 1–2 hours.