Skip to main content

Setting Up Ga4 Server Side Tracking With Gtm

Xander Sebastian Xander Sebastian Published

Step-by-step guide to deploying a GTM server container, routing GA4 events through your first-party domain, and verifying data integrity.

1 min read

The GTM server-side setup we deploy for every client routes all GA4 events through a first-party subdomain hosted on Google Cloud Run — same container architecture across every account, same verification steps, same data-integrity checks at the end. What follows is a record of that deployment: what a standard RP tracking infrastructure install looks like from container creation through to data-stream verification. The step-by-step is there for anyone auditing what we built. The result of a complete deployment is every GA4 event routing through a first-party endpoint, client-side and server-side containers talking correctly, and the tracking gap that most browser-side setups carry closed to under three percent.

What you need before you start

A Google Cloud account with billing enabled. Access to your domain DNS settings. An existing GA4 property with at least one web data stream configured. A GTM web container already installed on your site.

Step 1: Create your server container

In GTM, create a new container and select Server as the target platform. Download the provisioning configuration file — you will need this when deploying to Cloud Run. Set the environment to production and note your preview server URL for testing.

Continue reading

Ready to put AI to work in your marketing?

Book a Fit Call — 20 minutes to find out if we're the right fit. No pitch deck, no fluff. If we are, a Foundation Sprint sets the scope.