TL;DR
The generator builds a GA4 file for your server container, and that is all it does. It doesn't touch your web container, and the GA4 client's client-ID mode is yours to check and set after the import. The extension's Measurement Protocol keeps posting straight to Google, outside the server container, so the client-ID mode has to suit a stream that arrives by two routes. Get those two settings right and the rest is a preview check.
Key Takeaways
- The generator is a PRO feature, in beta since v1.14.7 (August 29, 2024), and it expects a provisioned server container, a working web container and a GA4 tag already sending to the server [1].
- Read Account ID, Container ID and Public ID from the server container. The admin note under each field says so.
- Merge the import when the server container already carries tags for other destinations; Overwrite "will remove all your existing tags, triggers and variables" [6].
- If any event stays on the Measurement Protocol, set the GA4 client to JavaScript Managed. Google says Server Managed IDs need every measurement of the stream to flow through the server [7].
- Add
server_container_urlto the web Google tag by hand, and re-check it after every import of a regenerated web container. - In server preview, check which client claimed each request, that each tag fired once, and which events reached no tag [10].
What the generator expects before you start
The extension's guide lists three conditions: "An already-provisioned Google Tag Manager Server-Side Container", a fully configured client-side GTM container, and "Your GA4 Client-Side Tag configured to send data to your Server-Side container" [1] (the third is the server_container_url setting covered further down). It calls the feature beta, "limited to generating a JSON file which can be imported into an already created and configured Google Tag Manager Server-Side container", and "geared towards advanced users" [1]. It arrived in v1.14.7 (August 29, 2024) as a PRO feature [1]; the Standard vs PRO comparison has the tier detail.
Whether you need a server container at all is a separate decision, and the client-side vs server-side comparison makes it. The short criterion: the extension's main server path is the Measurement Protocol, which runs with no tagging server, as the server-side setup guide shows. A server container is infrastructure you host. It earns that when you route other destinations through it as well.
Is your GTM server container on Google's current setup?
Our 2022 walkthrough on creating a server-side GTM container still explains the concepts, but the series it opens was written for App Engine (its custom-domain and production steps use App Engine screens), and Google has moved on. Automatic provisioning now "sets up a new GCP project and a Cloud Run tagging server" [2]. The App Engine setup page opens with "Tip: The recommended deployment option is Cloud Run" [3]. A manual Cloud Run setup provisions "a preview server to enable the preview feature for the container", and Google documents an optional migration from App Engine [4].
Two of Google's recommendations matter for the steps below. A new tagging server starts on a default run.app URL, and Google says "To improve cookie privacy and durability, point a subdomain of your website to the tagging server" [2]. Before production traffic, it says to set the server container up on your first-party domain and enable production mode [5]. Follow Google's pages for both. If you're unsure, check the tagging server's URL. If it isn't a subdomain of your own site (a run.app address, for instance), the default domain is still in place.
Generate the file from the server container's IDs
In the GA4 PRO configuration, find the group labeled Server-side Google Analytics Tracking (Beta). It has three fields, Account ID, Container ID and Public ID, and the admin note under each one reads "Make sure these values are taken from the Google Tag Manager Server container". These are the same three kinds of value you read from the web container for the client-side import, only this time from the server container. The easy slip here is pasting the web container's IDs out of habit. The Measurement ID comes from the GTM API Configuration section you already filled in for the web container.
Save the configuration, click Generate Server Side Json for Variables, Triggers and Tags, then Download Server Side Json. Since v1.17.5 (September 16, 2026), the export and download actions "declare the GA4 settings permission", and the generate actions "accept POST only" [1]. An admin role without the GA4 settings permission can't produce the file.
The file holds a GA4 client, the Measurement ID as a variable, and GA4 tags for the events the extension tracks. The guide's own description is "complete with all eCommerce tracking tags" [1].
Merge or overwrite when you import?
In the server container, click Admin, then Import Container, then Choose container file, and pick a new or existing workspace [6]. A new workspace keeps the import away from anything you're editing and lets you read the changes before you publish.
Then choose the option, using Google's definitions [6]:
| Import option | What Google says it does | Use it when |
|---|---|---|
| Overwrite | "will remove all your existing tags, triggers and variables, and will replace them with those in the imported container" | The container holds nothing you want to keep |
| Merge, overwrite conflicting | Same-named items with different contents are replaced by the imported ones | You want the generated GA4 items to win, and keep everything else |
| Merge, rename conflicting | Same-named items with different contents are imported under a new name | You want to compare the generated items with your own before choosing |
With Overwrite, Google adds that "A new container version will be created before the import" [6]. Whatever you choose, open Clients afterwards and look at which GA4 client is there; the preview step below shows which one claims your requests.
Which client-ID mode should the GA4 client use?
This is the setting to check after every import, and on a Magento store running PRO it decides whether server-side purchases still join the shopper's session.
The extension's Measurement Protocol never passes through your server container. It posts from the Magento backend straight to Google with no tagging server involved, using the client ID it reads from the visitor's GA cookie. Our Unassigned diagnosis walks through that join.
Now Google's two rules. On Server Managed, "server-side tagging will manage a separate client ID and substitute it for measurements it processes", and "If you use this option, you must ensure that all measurements for your stream flows through your server tag, and none is sent directly to Google servers" [7]. Google's server-side tagging course, configuring the same GA4 client, says to set Cookies and Client Identification to "JavaScript Managed, as that's the only method that will work until you change the domain settings of your server container" [8].
Side by side, they give one criterion:
| Your setup | GA4 client mode |
|---|---|
| Any event of the stream on the Measurement Protocol (purchase, refund, any checkout step) | JavaScript Managed |
| Tagging server not yet on a subdomain of your site (still on its default URL) | JavaScript Managed |
| Every event through the server container, on your own subdomain | Server Managed is an option, with Google's over-time migration if you have existing traffic [7] |
Open the imported GA4 client, check Cookies and Client Identification, and set it by this table before you publish. Don't assume the imported value suits your store.
The guide's routing rule applies here too: "only track events on one side or another" [1]. With Automatically disable data layer for enabled measurement protocol events switched on, an event selected for the Measurement Protocol gets no dataLayer push at all [1], so it never reaches the server container either. With that option on and purchase on the Measurement Protocol, server preview shows no purchase while GA4 keeps recording them. That's the configuration working as set.
Point the web Google tag at the server, and keep it pointed
The generated web container doesn't send anything to your server container. Google's instruction, done in the web container [9]:
- In Variables, create a new user-defined variable of type Google tag: Configuration settings.
- Add the parameter
server_container_url, with the server container's URL as the value, and save the variable. - In Tags, open the Google tag, select the variable under Configuration settings, and use the Initialization - All pages trigger.
- Save the tag and publish the container.
If your store sends a Content Security Policy that lists hosts, Google gives the server container URL under img-src, connect-src and frame-src [9].
This edit doesn't survive a careless re-import. The guide asks you to "re-generate the JSON and re-import and overwrite the existing GTM container" after configuration changes, and an overwrite removes "all your existing tags, triggers and variables in that workspace" [1]. That takes the variable with it. A merge that overwrites conflicting items can replace your edited Google tag with the generated one. After any re-import of the web container, re-add the setting if it's gone and confirm it in preview. The client-side import itself is covered in the setup guide linked above.
Check both containers in preview
Run the web container and the server container in preview together; Google notes that in that case the server sees each hit unbundled [10]. Place a test order, then read each incoming request in the server preview:
- Client: "Check the right client claimed the request". Google's own wording is that "only one client can claim a request" [10].
- Tags Fired: each box shows "the number of times the tag fired" [10]. One fire per event is the target.
- Tags Not Fired, and events with no tag: the imported tags cover the extension's ecommerce events. Any other event the GA4 client claims, an engagement event for example, reaches no tag until you add one. Decide whether you want it forwarded.
- Outgoing requests: the response "returned by the vendor endpoint" should show a success [10].
Our older article on previewing and debugging a server container has more on the panels, with the 2022 screens.
FAQ
Does the server container follow the shopper's consent?
Everything that reaches your server container comes from the GTM container in the browser, so it follows the Consent Management Method in the GA4 configuration (with Magento Cookie Restriction Mode as the method and Magento's own Cookie Restriction Mode switched on, the container loads only after the shopper accepts cookies); the Measurement Protocol is a separate path, and since v1.17.4 it is gated on the shopper's Consent Mode v2 choice only when Require Visitor Consent for Server-Side Events is switched on, as the server-side consent guide explains [1].
Does the generated file send data to Google Ads or Meta?
It covers GA4: a GA4 client and GA4 tags. Any other destination in the server container needs tags you add yourself.
Is the generated Cloudflare Worker a server container?
No. The First-Party Tracking Worker serves GA4 and GTM from your own domain, a separate option with its own setup in our Cloudflare Worker guide.
Can I use Google Tag Manager for server-side tagging?
Yes, in a GTM server container running on a tagging server you host; Google's automatic provisioning sets one up on Cloud Run [2]. For this extension you only need one if you route other destinations through it, since its main server path, the Measurement Protocol, runs with no tagging server.
How do I set up server-side GTM?
Provision a server container (Google's automatic provisioning creates a Cloud Run tagging server [2]) and point a subdomain of your site to it. In GA4 PRO, fill Server-side Google Analytics Tracking (Beta) with the server container's Account ID, Container ID and Public ID, generate and download the file, and import it into the server container. Then set the GA4 client's client-ID mode and add server_container_url to the web Google tag.
What does "server-side GTM" mean?
It's Google Tag Manager running in a server container on a tagging server you host, instead of in the shopper's browser. The GTM container in the browser sends its requests there, a client such as the GA4 client claims each one, and tags pass the data on to GA4 or other destinations.
Generate the server container file in the Magento 2 Google Analytics 4 extension PRO edition, then decide client IDs and routing before you publish. The current release is v1.17.5, September 16, 2026 [1].
Sources
- WeltPixel Google Analytics 4 User Guide and Change Log, v1.17.5, September 16, 2026, retrieved October 8, 2026, https://docs.weltpixel.com/GA4/User-Guide-WeltPixel-Google-Analytics-4.html
- Server-side tagging (overview), Google Tag Manager server-side documentation, last updated July 30, 2026, retrieved October 8, 2026, https://developers.google.com/tag-platform/tag-manager/server-side/overview
- Set up server-side tagging with App Engine, Google Tag Manager server-side documentation, last updated May 12, 2026, retrieved October 8, 2026, https://developers.google.com/tag-platform/tag-manager/server-side/app-engine-setup
- Set up server-side tagging with Cloud Run, Google Tag Manager server-side documentation, last updated May 12, 2026, retrieved October 8, 2026, https://developers.google.com/tag-platform/tag-manager/server-side/cloud-run-setup-guide
- An introduction to server-side tagging, Google Tag Manager server-side documentation, last updated July 30, 2026, retrieved October 8, 2026, https://developers.google.com/tag-platform/tag-manager/server-side/intro
- Container export and import, Tag Manager Help, retrieved October 8, 2026, https://support.google.com/tagmanager/answer/6106997?hl=en
- Tagging best practices to avoid unassigned, (not set), and direct traffic issues (Server-side tagging section), Analytics Help, retrieved October 8, 2026, https://support.google.com/analytics/answer/14847402?hl=en
- Configuring the Google Analytics data stream with server-side tagging, Server-side tagging fundamentals, last updated July 30, 2026, retrieved October 8, 2026, https://developers.google.com/tag-platform/learn/sst-fundamentals/5-sst-setup-analytics
- Send data to server-side Tag Manager (Google Tag Manager option), last updated July 30, 2026, retrieved October 8, 2026, https://developers.google.com/tag-platform/tag-manager/server-side/send-data?option=GTM
- Preview and debug server containers, Google Tag Manager server-side documentation, last updated July 30, 2026, retrieved October 8, 2026, https://developers.google.com/tag-platform/tag-manager/server-side/debug