← All resources Tutorial

GA4 server-side: the basics

Hover over a part to see what it does. Click a cube or a data block to pause the story there, or step through it with the buttons at the bottom right.

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 Google Analytics tag (Tag Manager's Destination tag that replaced the Google tag and the GA4 configuration 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.

Continue reading

Ready to improve your tracking setup?

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

Start free