Why can’t I set up server-side tracking in Tag Manager?

Kilian Müller
Kilian MüllerOwner of 1hold.de · Google PartnerUpdated
Google Tag ManagerGoogle Certified Specialist

Server-side tracking in Tag Manager almost always fails at one of four points: there is no server container with a running tagging server, the Google Cloud project has no billing account, your own subdomain is not set up correctly, or the Google tag on the website does not send to the server at all. Tag Manager alone is not enough; server-side tagging needs its own server, and that costs money.

Want your tracking set up for you? Tracking agency →

One thing first: server-side tagging does not change consent requirements. What may not be collected without consent may not be collected via the server either.

What does server-side tagging need?

  • A server container. In Tag Manager you create a new container with the target platform Server. An existing web container cannot be switched over.
  • A tagging server. The container does not run inside Tag Manager but on a server, for example on Cloud Run in Google Cloud. Automatic provisioning creates it, but requires a Google Cloud project with a billing account.
  • Your own subdomain. For cookies to count as first-party, the server runs on a subdomain of your website, for example sgtm.your-domain.com. That needs a DNS record and a valid certificate.
  • A connection from the website. In the web container’s Google tag you enter the server URL as server_container_url. Only then does data go to your server instead of directly to Google.

Why does the setup not work?

  1. No billing account. If automatic provisioning stops, the Google Cloud project usually lacks a billing account, or you lack permission to link one.
  2. Only the test server is running. Automatic provisioning creates a configuration for testing. According to Google, the server has to be scaled up for production before real traffic, otherwise data is lost under load.
  3. DNS or certificate missing. If the subdomain does not point to the server, or the certificate has not been issued yet, no requests arrive. A new DNS record can take a while to apply everywhere.
  4. The website does not send to the server. Without server_container_url in the Google tag, all requests keep going directly to Google and the server container stays empty.
  5. No client claims the request. In the server container a client, such as the GA4 client, has to claim incoming requests. Without a matching client, no tag fires.

How do I check whether data reaches the server?

  1. Open https://your-subdomain/healthy in the browser. If the server answers “ok”, it is reachable.
  2. Start preview mode in the server container and, in parallel, in the web container. Every page must appear as a request in the server preview.
  3. Open a request in the server preview and check which client claimed it and which tags fired.
  4. In the browser’s developer tools under Network, check that requests go to your subdomain and not to google-analytics.com.

Set up the server container, billing account and subdomain first and test with preview mode. Only then switch the website over with server_container_url, and scale the server to a production configuration before going live.

Sources

Want server-side tagging set up properly, without data gaps and with consent? We set up server, subdomain and containers and test every step. Book a free intro call or read more about our tracking.

Need personal advice?

Our Google-certified experts are happy to help – free and without obligation.

Book a meeting