Configure a server-side GTM container and deploy a custom tag template that forwards events to a first-party endpoint

domain: developers.google.com/tag-platform/tag-manager/server-side · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Provision a server-side GTM container by creating a new container in the Tag Manager UI with target platform set to Server, and deploy the tagging server to Google Cloud Run (App Engine or Cloud Run are the supported hosting targets)
  2. Update your web GTM container to send events to the first-party tagging server domain instead of directly to vendor endpoints, by routing the GTM snippet's transport_url to your server container's URL
  3. In the server container, create a Client template that listens for incoming requests (e.g. from GA4 or a custom HTTP client) by implementing the claimRequest() and runContainer() APIs
  4. Author a Tag template in the server container using sandbox JavaScript APIs (sendHttpRequest, getEventData, setResponseHeader) to forward the transformed event payload to the desired destination
  5. Add a Trigger in the server container that fires the tag when the appropriate event name is present in the container data
  6. Preview and debug the pipeline using the server container's preview mode, which streams event data and tag firing status to the Tag Assistant debugging interface

Known gotchas

Related routes

Configure a Helm post-renderer using kustomize to inject sidecar containers and custom annotations into a third-party chart's output without forking the chart
Helm · 6 steps · unrated
Send server-side events to TikTok Events API (v1.3)
business-api.tiktok.com · 6 steps · unrated
Deploy Meta's Conversions API Gateway as a first-party server-side event relay
developers.facebook.com · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans