● Server-Side Tracking

Server-Side GTM Setup and Hosting

We set up the server-side Google Tag Manager foundation: the server container, hosting on Cloud Run or Stape, a custom subdomain, clients and monitoring. It becomes the single collection point that GA4, Google Ads, Meta and future tags can use. For businesses starting their server-side move.

Server-Side GTMIllustrative
  1. Web Container
  2. Custom Subdomain
  3. Server Client
  4. Server Tags
  5. Vendor Endpoints
What this covers
  • Server container created and owned by you
  • Cloud Run or Stape hosting
  • Custom subdomain with DNS mapping
  • Preview server and access control
Platforms
Server-Side GTMGoogle Cloud RunStapeWeb GTMDNS ProviderCloud Logging
Best for

Teams starting server-side tracking or cleaning up an sGTM container set up without a plan

01 The problem

What Goes Wrong With Rushed sGTM Setups

A server container is infrastructure, not just another tag. Quick setups often run on the wrong domain, the wrong account or without anyone watching them.

  1. 01

    Default Domain Left in Place

    Containers running on an appspot or vendor URL lose the first-party benefit, because cookies cannot be set on your own domain.

  2. 02

    Unclear Ownership

    Hosting billed to a freelancer or agency account means you can lose the container, its settings and history if that relationship ends.

  3. 03

    No Monitoring or Scaling Plan

    Undersized instances or missing alerts can drop requests during traffic peaks without anyone noticing.

02 What we implement

What We Build for Your Server Container

This is the infrastructure layer. Once it is in place, platform tags for GA4, Google Ads and Meta can be added cleanly on top.

  • 01

    Server Container Provisioning

    A server container created in your GTM account, with the config string connected to your chosen host.

  • 02

    Hosting Setup

    Cloud Run services in your own Google Cloud project, or a Stape container under your account, sized for your traffic.

  • 03

    Custom Subdomain Mapping

    DNS records and SSL for a subdomain like sgtm.yoursite.com so the endpoint is first-party.

  • 04

    Preview Server

    A separate preview service so your team can debug server requests without affecting production traffic.

  • 05

    Clients and Routing

    Clients such as GA4 configured to claim incoming requests, with rules for which paths the server accepts.

  • 06

    Logging and Alerts

    Request logging and uptime or error alerts so problems with the container surface quickly.

03 Live data flow

How Requests Flow Through Server-Side GTM

The browser sends one stream to your subdomain. The server container decides where each event goes next.

Server-Side GTM data flowIllustrative
  1. 01Web ContainerCaptures events in the browser
  2. 02Custom SubdomainDNS points to your sGTM host
  3. 03Server ClientClaims and parses the request
  4. 04Server TagsGA4, Google Ads, Meta and others
  5. 05Vendor EndpointsData sent server to server
04 How it works

From audit to validated data.

How Server-Side GTM projects run. Nothing goes live until it has been tested.

  1. 01

    Audit

    Audit current tagging, domains, consent setup and any existing server container

  2. 02

    Strategy

    Choose hosting, subdomain and ownership model, and plan which clients are needed

  3. 03

    Implementation

    Provision the server container, hosting, DNS mapping and preview server

  4. 04

    Testing

    Test requests from the web container in server preview and check cookie domains

  5. 05

    Validation

    Validate uptime, logging and alerts, then hand over the infrastructure runbook

05 Deliverables

What's Included in Server-Side GTM

Everything is documented and handed over, so your team knows exactly what was built and why.

  • 01

    Production Hosting

    Server container live on Cloud Run or Stape, billed to your account and sized for your traffic.

  • 02

    First-Party Domain

    Custom subdomain mapped with DNS and SSL, tested from the browser to confirm first-party requests.

  • 03

    Access and Ownership

    GTM and hosting permissions set so your business owns the container and controls who can publish.

  • 04

    Scaling Settings

    Minimum and maximum instances configured with room for traffic peaks and seasonal campaigns.

  • 05

    Monitoring Setup

    Logs and alerts configured so errors or downtime are visible to your team.

  • 06

    Infrastructure Runbook

    Documentation of hosting, DNS, container IDs, preview access and how to update the server image.

Platforms

The tools involved in a typical Server-Side GTM implementation.

  • Server-Side GTMServer container
  • Google Cloud RunSelf-managed hosting
  • StapeManaged hosting
  • Web GTMBrowser event capture
  • DNS ProviderSubdomain records
  • Cloud LoggingRequests and errors
06 QA and testing

Tested before anything goes live.

Test requests from the web container in server preview and check cookie domains. Validate uptime, logging and alerts, then hand over the infrastructure runbook.

QA checklistServer-Side GTM
  • sGTM PreviewIncoming requests claimed by the right clientchecked
  • Outgoing requestsEach vendor request checked for payload and statuschecked
  • First-party checksEndpoint and cookies served from your own subdomainchecked
  • Platform debugGA4 DebugView, Google Ads diagnostics and Meta Test Eventschecked

Each check is repeated after launch on live traffic.

07 FAQ

Server-Side GTM FAQ

Something else? Talk to GrowthUper

Should I host on Google Cloud Run or Stape?

Cloud Run gives you full control inside your own Google Cloud project and suits teams with some cloud experience. Stape is a managed option that handles scaling and updates for you. We compare both against your traffic and team before choosing.

Why does the custom subdomain matter?

Without it, requests go to a default host URL that is not part of your domain, so cookies cannot be set first-party. Mapping a subdomain like sgtm.yoursite.com is what makes the server container a true first-party endpoint.

Who owns the container and hosting account?

You do. The server container sits in your GTM account and hosting is billed to your Google Cloud or Stape account. We work with delegated access, so nothing depends on us after handover.

Does this include GA4, Google Ads or Meta tags?

This service builds the server infrastructure and core clients. Platform tags are covered by our GA4, Google Ads and Meta server-side services, and they are often scoped together in one project.

What maintenance does a server container need?

Hosting images need occasional updates, tag templates get new versions, and traffic changes may require scaling adjustments. The runbook explains each task so your team or ours can handle them.

→ Next step

Get Server-Side GTM right the first time.

Build a tracking and measurement system you can trust.

Get Free Tracking Audit Talk to GrowthUper Free 30-minute review · No obligation
Scroll to Top