If you’re in the process of implementing server-side Google Tag Manager (sGTM), you may come across an issue or two that you’re questioning. One common case that we’ve run into is improper hit routing—some requests are sent to google-analytics.com and some requests are sent to your GTM Server.
This can happen if the Google Analytics 4 (GA4) configuration tag, which determines where to route hits, isn’t triggered before the GA4 event tags. If you have properly configured the GA4 config tag during implementation, you should see a 1 to 1 match between client-side hits and server-side hits in the GTM Web Container Debug Mode and GTM Server Container Preview Mode. Here’s how to check.
First, begin by looking at your hits in the GTM web container using Debug Mode. Click on the GA4 property. The “gtag hit” means it’s routing to GTM Server (subdomain.domain.com), while a “Google Analytics Hit” means it’s routing to google-analytics.com (Google Analytics Servers)
If you’re expecting to send GA4 hits to your GTM Server, you need to ensure your GA4 config tag is triggered before any GA4 Event Tag.
Here’s how to make sure that happens:
This order allows for the configuration tag to be the first tag that fires, allows all parameters necessary to be utilized by the required tags on that page and allows for the 1st party cookie to be set on the page view before the conversion occurs.
Have questions or need more sGTM help? We’re here and ready to help you. Contact us, and let’s talk!