Server-side Google Tag Manager (ssGTM) is a version of GTM that runs on a server you control rather than in the visitor’s browser. Instead of ad platform pixels firing directly from the browser, your browser sends events to your GTM server, which then forwards them to Meta, Google, TikTok, and other platforms. This gives you more control over your data, improves first-party cookie lifespans, and removes your ad tracking from the reach of browser-based ad blockers.
How Server-Side GTM Works
Traditional (browser-side) GTM: Browser loads GTM container → GTM fires tags → tags send events directly to Meta, Google, etc.
Server-side GTM: Browser loads GTM client-side container → sends event data to your ssGTM server → ssGTM processes and enriches the data → ssGTM sends events to Meta CAPI, Google Measurement Protocol, TikTok Events API, etc.
Your server acts as a proxy and enrichment layer between your website and the ad platforms. Because the final requests to ad platforms come from your server (not the browser), they cannot be blocked by browser-based ad blockers.
Key Benefits of Server-Side GTM
First-party cookies with longer lifespans
ITP (Intelligent Tracking Prevention) in Safari limits third-party cookies to 7 days and reduces some first-party cookies to 7 days as well. When ssGTM sets cookies on your subdomain (e.g. gtm.yourdomain.com), they are treated as genuine first-party cookies by the browser, with lifespans up to 400 days in most browsers. This significantly improves attribution for Safari users.
Ad blocker resilience
Requests to meta.com, facebook.net, google-analytics.com, and other ad platform domains are commonly blocklisted. When traffic is routed through your own server, these domains are never reached from the browser — the browser only talks to your subdomain.
Centralised server-side API forwarding
ssGTM includes pre-built tags for Meta CAPI, GA4 Measurement Protocol, Google Ads conversion forwarding, and more. Instead of building separate API integrations for each platform, you configure tags in the familiar GTM interface and the server handles the API calls.
Data enrichment and filtering
Before forwarding events to ad platforms, ssGTM can enrich them with server-side data (order details from Shopify, customer data from your CRM), strip PII from events sent to third-party platforms, or apply business logic that is difficult to execute in the browser.
Server-Side GTM Setup Overview
Step 1: Create a server-side GTM container
In GTM, go to your account and create a new container. Select “Server” as the platform type. GTM will generate configuration instructions and a tagging server URL.
Step 2: Deploy the ssGTM server
ssGTM requires a cloud server to run on. Common options:
- Google Cloud Run (Google’s managed serverless platform, recommended for ease)
- Amazon AWS (EC2 or ECS)
- Any Linux VPS (DigitalOcean, Hetzner, Linode)
Cost: Google Cloud Run for typical ecommerce load runs approximately $20–50/month. Higher traffic stores may pay more.
Step 3: Point a subdomain at your ssGTM server
Create a subdomain on your own domain (e.g. gtm.yourdomain.com or metrics.yourdomain.com). Point it to your ssGTM server. This is what makes cookies set by ssGTM appear as first-party to browsers.
Step 4: Update your client-side GTM container
Modify your existing GTM container to send events to your ssGTM server URL instead of (or in addition to) sending them directly to ad platforms. Add a GA4 tag pointing to your ssGTM server, and update the GA4 configuration to use your custom server endpoint.
Step 5: Configure server-side tags
In the ssGTM interface, add tags for each platform you want to receive forwarded events: Meta CAPI tag, GA4 server-side tag, Google Ads Conversion Linker, TikTok Events API tag. Configure each tag to fire on the relevant triggers (Purchase, AddToCart, etc.).
When Does Server-Side GTM Make Sense?
ssGTM requires more setup effort and ongoing hosting costs than browser-side GTM. It is most justified for:
- Stores spending $20k+/month on ads where data loss has significant budget impact
- Stores with audiences that include many ad-blocker users
- Stores that need improved cookie longevity for Safari users
- Stores that handle multiple ad platforms and want centralised server-side API management
For smaller ad budgets, simpler per-platform CAPI integrations (directly with Meta CAPI or TikTok Events API) may be more cost-effective than the full ssGTM infrastructure.
Get Expert Guidance on Your Tracking Architecture
Server-side GTM is a significant but worthwhile investment for high-spend ecommerce advertisers. Getting the setup right the first time — including deduplication, subdomain configuration, and tag forwarding — requires careful implementation.
Book your free Shopify tracking audit here and we will assess whether ssGTM is the right solution for your store and walk you through what a proper implementation would look like.