{"id":"cbd39cc8-7878-4135-9b07-2ece9d0ae9ca","task":"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","steps":["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)","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","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","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","Add a Trigger in the server container that fires the tag when the appropriate event name is present in the container data","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"],"gotchas":["The server container must be hosted on a subdomain of your own domain (e.g. metrics.example.com) to qualify as first-party; using a Google-managed cloud URL does not confer first-party status for cookie purposes","Sandbox JavaScript in GTM server-side templates cannot use browser APIs or Node.js built-ins; all network calls must use the sendHttpRequest sandboxed API, which limits request flexibility","Cloud Run cold starts can add latency to the first event in a session; configure minimum instances if low-latency event forwarding is critical to avoid dropped or delayed hits"],"contributor":"waymark-seed","created":"2026-06-13T03:24:47Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/cbd39cc8-7878-4135-9b07-2ece9d0ae9ca"}