⏱️ Setup time: ~15 minutes | Level: Intermediate
Why GA4 server-side?
A standard GA4 implementation via client-side GTM loses 25-35% of data to ad-blockers and ITP restrictions in Safari. A server-side setup solves this by sending data through your subdomain.
Prerequisites
- A GA4 property with a Measurement ID (format G-XXXXXXXXXX)
- A deployed sGTM container (see the sGTM Basics guide)
- Access to the GTM web container
Step 1: Configure the GTM web container
- Open your web GTM container
- Edit the GA4 Configuration tag
- In the Transport URL field, enter the URL of your sGTM endpoint (e.g.
https://sgtm.yourdomain.cz) - Tick Send to server container
- Publish the changes
Step 2: sGTM container — GA4 Client
A GA4 Client should be pre-configured in the sGTM container. Verify that:
- The client is active and receiving requests
- The default GA4 paths are set (
/g/collect)
Step 3: GA4 Event Tag in sGTM
Create a GA4 tag in the server-side container:
- Tag type: Google Analytics: GA4
- Measurement ID: your G-XXXXXXXXXX
- Trigger: set it to All Pages (or a custom trigger)
- Save and publish
Verification
Checklist:
- ✓ You see active users in the GA4 Realtime report
- ✓ You see incoming requests in sGTM Preview Mode
- ✓ The browser's Network tab shows requests to your subdomain (not google-analytics.com)
- ✓ An ad-blocker didn't block tracking (test with uBlock Origin)