GuidesGA4 Server GTM

Google Analytics 4 - Server Tag

Server GA4 Tag Setup

Configure the GA4 client and tag in your server-side GTM container, then connect your web tag to the server container URL.

Server GA4 Tag Setup

Clients Tag in Server GTM

Verify that the GA4 tag exists in the Clients section of the Server Side GTM account.

In the built-in GA4 client, enable Default GA4 paths, Default gtag.js paths with your GA4 Measurement ID, and Automatically serve dependent scripts. Set Cookies and Client Identification to JavaScript Managed, then save.

GTM server container with the GA4 web client listed under Clients.
GTM server container with the GA4 web client listed under Clients.

Tags Section

Go to the Tags section, select and add the Google Analytics: GA4 tag. Add the Measurement ID of the GA4 account that is active in the Client GTM account. Leave the Event Name field as {{Event Name}}.

Trigger

Add a trigger with the condition Client Name equals GA4 so the tag fires for events claimed by the GA4 client.

GA4 tag configuration in server-side GTM with the firing trigger shown below the tag settings.
GA4 tag configuration in server-side GTM with the firing trigger shown below the tag settings.

Client Side GA4 Tag Setup

On the client side, the server_container_url parameter is added to the GA4 tag. The Measurement ID is checked.

Set server_container_url to your Hardal sGTM Tagging URL, use the All Pages trigger for the Google Tag, then save and publish the web container.

In the client-side GA4 tags, the Consent Settings field is set to “No additional consent required”.

Google tag configuration with server_container_url set to the tagging server address.
Google tag configuration with server_container_url set to the tagging server address.
Consent settings on the web tag with No additional consent required selected.
Consent settings on the web tag with No additional consent required selected.

Test Implementation

  1. Enable Preview mode in both containers
  2. Navigate to your website
  3. Verify events reach server container
  4. Confirm GA4 tag fires in server container
  5. Check GA4 Real-Time reports for event delivery

You can check this in your browser's DevTools >> Network tab. The client-side tag should now send data to your server container URL (e.g., sgtm.example.com) instead of google-analytics.com. If requests are still going directly to GA, the server_container_url setting might be missing in the client-side configuration.