← All resources Tutorial

GA4 server-side: the basics

Google Analytics 4 is the most common first tag teams move server-side. The flow is straightforward once you see how web and server containers divide the work.

The event path

  1. Your site loads the client GTM script from your tagging subdomain
  2. Web container tags fire and send events to the server container
  3. Server container clients parse incoming requests
  4. GA4 tags in the server container forward data to Google

Web container: keep it thin

Best practice is to minimise tags in the web container. Use a single GA4 configuration tag (or Google tag) that sends to your server container URL. Add event tags only where client-side data is needed before the hit leaves the browser.

Server container: enrichment & routing

The server container is where you add user properties, strip PII, and route the same event to multiple destinations. Create a GA4 tag with your Measurement ID and trigger it on the client events you receive.

Debugging

Use GTM preview mode on both containers simultaneously. In Measurebase, check domain request logs to confirm hits arrive. In GA4, use DebugView for real-time validation. If preview breaks with the Enhanced loader, temporarily switch to the Standard script while debugging.

Continue reading

Ready to move your tagging to Europe?

Start free, no credit card required. Live in about 15 minutes.

Start free