Server-side GTM and Google Tag Manager

Server-side GTM adds a server container next to your web container; these guides cover both, from the first tag to consent, audits and debugging. 21 articles

Google Tag Manager works with two kinds of container. The web container runs in the browser and holds your tags, triggers and variables. The server container runs on a tagging server and starts with clients, which claim incoming requests and turn them into events that server tags forward to Google and other platforms. Server-side GTM is the two working together.

Set up the web container first, then the server container with its two clients. What connects them is server_container_url on the Google Analytics tag; without it, hits bypass your server container and go straight to Google.

Consent starts in the web container too: Cookiebot in Google Tag Manager goes from an empty tag to a tested setup. Further down are guides for GA4 events and e-commerce, duplicate tracking, the new Destination tags and debugging in Preview mode.

Start here: Setting up and configuring a server GTM container

Server-side GTM and Google Tag Manager

Frequently asked questions

What is the difference between a web and a server container?

A web container runs in the visitor's browser and fires tags on triggers such as a page view or a click. A server container runs on a tagging server and starts with clients, which claim incoming requests and turn them into events. Server tags then forward those events, for example a GA4 tag that sends them to Google.

Why does my server container receive no events?

On a fresh setup, usually because the Google Tag Manager: Web Container client is missing, or your web container ID is not listed under Allowed Container IDs. The script loads, but every event is rejected. Also check that both containers are published: one side live and the other in draft works in preview only.

Does Preview mode still work with server-side GTM?

Yes, for both containers. In the server container, Tag Assistant opens the first address under Server container URLs, so that must be the address your site sends to. If the preview stays empty, close both tabs and start Preview again from the server container. Debugging with Preview mode covers the other causes.

Put it into practice

Start free, no credit card required.

Start free