Server-Side GTM and Consent Management

Server-side Google Tag Manager gives you full control over event processing and data flow. UniConsent ensures consent checks run before any data is forwarded to third parties.

IAB registered consent manager for GDPRIAB TCF V2 registered consent manager for GDPRIAB TCF Canada registered consent managerGoogle-certified CMPGoogle-certified CMP
Trusted by 5000+ of global publishers and marketers
  • sej
  • football365
  • sharethrough
  • districtm
  • pf1
  • tower cast

What Is Server-Side GTM?

Server-side Google Tag Manager (sGTM) routes tag requests through a server-side container rather than firing them directly from the browser. Instead of pixels and tags running in the user's browser, events are sent from your web container to a server-side container that you control, which then forwards the data to Google and other platforms.

This gives you full control over what data leaves your environment. You can inspect, modify, or block events before they reach any third party. Consent checks run server-side before data is forwarded, which means blocked events never leave your infrastructure.

Server-side GTM is commonly deployed on Google Cloud Run, App Engine, or similar cloud hosting. It works alongside client-side GTM, not as a replacement. The client-side container collects events and passes them to the server-side container for processing.

Why Server-Side GTM Matters for Consent

Client-side pixels are increasingly blocked by ad blockers, browser privacy features, and iOS restrictions. Server-side event forwarding bypasses those blocks because the data goes from your server to the platform directly. However, this makes consent management more important, not less: you are responsible for ensuring that events are only forwarded when the user has given consent.

UniConsent passes consent state to the client-side GTM container, which forwards it to the server-side container. Events are only processed and forwarded when the appropriate consent has been granted. This ensures compliance while maintaining measurement coverage.

UniConsent and Server-Side GTM

  • UniConsent consent signals flow from the CMP to the client-side GTM container to the server-side container
  • Events are queued and only forwarded when consent is granted
  • Works with Google Ads, GA4, Meta Conversions API, and other server-side tag templates
  • Compatible with both Basic and Advanced Consent Mode
  • Advanced Consent Mode sends cookieless pings for conversion modeling even when consent is denied
  • Region-specific consent defaults are applied automatically based on user location

How to Get Started

  1. Sign up for UniConsent and install the CMP on your site
  2. Set up your server-side GTM container on Google Cloud Run or your preferred hosting
  3. Configure your client-side GTM container to forward events to the server-side container
  4. UniConsent consent signals are automatically included in the forwarded events
  5. Verify with the Consent Mode Scanner that consent is being respected

For Google Tag Manager setup, see our GTM integration tutorial.

Server-Side GTM vs Google Tag Gateway

Server-side GTM and Google Tag Gateway solve different problems and can be used together:

  • Google Tag Gateway serves Google tag scripts from your first-party domain, improving delivery rates. See our Google Tag Gateway guide.
  • Server-side GTM processes events on your server before forwarding them, giving you full control over the data flow.
  • GTG handles script delivery; sGTM handles event processing. Both benefit from proper consent management with UniConsent.

Frequently Asked Questions

What is server-side GTM?

Server-side Google Tag Manager routes tag requests through a server-side container that you control, rather than firing pixels directly from the browser. This gives you full control over what data leaves your environment and lets you apply consent checks before forwarding events to third parties.

Why use server-side GTM for consent?

Client-side pixels are increasingly blocked by ad blockers, browser privacy features, and iOS restrictions. Server-side event forwarding bypasses those blocks. With UniConsent, consent checks run before data is forwarded, so blocked events never leave your infrastructure.

How does UniConsent work with server-side GTM?

UniConsent passes consent state to the client-side GTM container, which forwards it to the server-side container. Events are only processed and forwarded when the appropriate consent has been granted.

Does server-side GTM replace client-side GTM?

No. Server-side GTM works alongside client-side GTM. The client-side container collects events and passes them to the server-side container for processing and forwarding.

Which platforms work with server-side GTM?

Server-side GTM supports Google Ads, GA4, Meta Conversions API, TikTok Events API, and many other platforms through server-side tag templates.

What is the difference between server-side GTM and Google Tag Gateway?

Google Tag Gateway serves Google tag scripts from your first-party domain. Server-side GTM processes events on your server before forwarding them. GTG handles script delivery; sGTM handles event processing. Both benefit from consent management with UniConsent.

Where do I host the server-side container?

The server-side GTM container is commonly deployed on Google Cloud Run, App Engine, or similar cloud hosting. Google provides setup instructions for Cloud Run as the default option.

Does conversion modeling work with server-side GTM?

Yes. When using Advanced Consent Mode with server-side GTM, cookieless pings are sent when consent is denied. These pings feed conversion modeling to recover measurement data.

IAB registered consent manager for GDPRIAB TCF V2 registered consent manager for GDPRIAB TCF Canada registered consent managerGoogle-certified CMPGoogle-certified CMP
Trusted by 5000+ of global publishers and marketers
  • sej
  • football365
  • sharethrough
  • districtm
  • pf1
  • tower cast

Get started to make your website and application compliant for EU GDPR, US CPRA, CA PIPEDA etc

Sign up