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:
- Web container: a GTM container still runs in the browser, collects events and sends them to your tagging server, usually in GA4 format.
- 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.