Setting up the GTM Server container

This GTM Server-side setup enhances data privacy, accuracy, and site performance by routing tracking through a secure server, ensuring reliable, compliant, and efficient analytics.

This GTM Server-side integration improves data privacy, accuracy, and site performance by routing tracking events through a secure server environment instead of the user’s browser. It ensures more reliable data by reducing the impact of ad blockers and browser restrictions, offloads third-party scripts to speed up page loads, and enables better compliance with privacy regulations. The setup also centralizes tracking management, enhances integration with platforms like GA4 and Google Ads, and future-proofs analytics against evolving privacy standards, making it a scalable and efficient solution for modern digital tracking needs.

If you are new to One Tag, check "Getting started with One Tag" first.

Setting up the GTM Server container

  • Create, if you haven't already, a GTM server side container and select "Manually configured" during the setup.
  • Go to container settings and add https://preview-mts.adsmurai.com as Server container URL.
  • Take the opportunity to copy the "Container Configuration" token as it will be needed later.
  • Copy the container's id (GTM-XXXX) too. 
  • Visit your One Tag settings and paste there your GTM Server container id as well as the "Container Configuration" token.
Back on GTM, head to “Clients” section and add "Google Tag Manager Web Container" client.
  • Add in "Allowed Container IDs" your GTM WEB container id.
  • Enable "Automatically serve all dependent Google scripts"
  • Enable "Compress HTTP response"
  • Disable "Enable region-specific settings"
  • If you want to send GA4 events, also add the "Google Analytics: GA4 (Web)" client.

Head to "Variables" and add a new "Event Data" variable, set x-ga-measurement_id as "Key Path" and save it with the name measurement_id.


Now head to "Triggers" section, and add a new trigger for each event you plan on sending.
  • Add Event Name -> equals -> YOUR_EVENT_NAME. Replace YOUR_EVENT_NAME with the name of the event you want to track.
  • Add measurement_id -> equals -> G-YOUR_ANALYTICS_ID. Replace G-YOUR_ANALYTICS_ID with the your Analytics ID.Screenshot from 2025-05-22 12-52-55
Publish your changes (preview of unpublished changes doesn't seem to work properly most of the times)

Setting up the GTM Web container

Go to "Tags" section and add, if isn't already there, a "Google Tag" tag.
  1. Set as "Tag ID" your GTM Server id like this: G-YOURGTMID. Example: If your GTM Server id is GTM-K4MML35 => G-GTMK4MML35 . THIS IS VERY IMPORTANT.
  2. Inside "Configuration settings" add as "Configuration parameter" -> "server_container_url" with the value https://mts.adsmurai.com

If you want to send GA4 events, then add a new GA4 tag for each event and set as "Measurement ID" your GTM Server id in the previous format of "G-YOURGTMID". The event name that we indicate in the GTM Web events is the event name that we have to use as a trigger in GTM Server

And we should be done! Add the rest of events and test your conversion tracking setup.