Tracking

Server-Side GTM

In short

Server-side GTM (sGTM) is the server version of Google Tag Manager: a self-hosted server container receives events and forwards them to ad platforms.

Also known as: sGTM, server-side Google Tag Manager

Server-side GTM (sGTM) is the server-side version of Google Tag Manager. Instead of running tags in the browser, your website sends events to your own server container, which processes them and forwards them to ad and analytics platforms.

How does server-side GTM work?

An sGTM setup has two parts:

  1. Web container: a GTM container still runs in the browser, collects events and sends them to your tagging server, usually in GA4 format.
  2. Server container: it runs on infrastructure you provision yourself, typically Google Cloud (Cloud Run) or a hosting provider like Stape. So-called clients receive the requests, and tags forward the data, for example to Meta's Conversions API.

When the tagging server runs on a subdomain of your site, requests happen in a first-party context. That helps against some ad blockers and can extend the lifetime of first-party cookies, although Safari still applies limits under certain conditions.

Pros and cons

Pros

  • Full control over data before it reaches third parties.
  • Fewer third-party scripts in the browser, potentially faster pages.
  • More robust than pure client-side tracking.

Cons

  • Ongoing hosting costs for the server container.
  • Setting up DNS, a subdomain, clients and tags takes serious technical skill.
  • Maintenance, monitoring and updates are on you or your agency.
  • Two containers to maintain, and errors often surface late.

Example

An online store sets up sGTM on Google Cloud, points tracking.shop.com at the server container via DNS and configures tags for the Meta Conversions API and GA4. An agency handles the setup, and hosting is billed monthly. For smaller teams, that effort is often hard to justify.

An sGTM alternative with LeadSignal

LeadSignal gives you server-side tracking without sGTM. You do not host a server container, configure a subdomain or need a developer. One script on your site is enough, and LeadSignal handles server-side delivery to the Meta Conversions API, the LinkedIn Conversions API and the TikTok Events API, including deduplication. Google Ads is currently connected browser-side. The guide to server-side tracking without GTM compares both approaches, and pricing shows what it costs.

Frequently asked questions

How much does server-side GTM cost?+

Tag Manager itself is free, but the server container is not. You pay for hosting on Google Cloud or with a provider like Stape. Depending on traffic and redundancy, costs often land somewhere between a few dozen and a few hundred dollars per month.

Do I need sGTM for server-side tracking?+

No. sGTM is a popular route, but not the only one. Some tools run the server infrastructure themselves and send events straight to APIs like the Meta Conversions API.

Is server-side GTM automatically GDPR compliant?+

No. Marketing data sent through sGTM generally still requires consent. sGTM does make it easier to control what data reaches third parties.

Guides on this topic

Articles on this topic

Related terms