TL;DR
Most guides on this topic conflate two different things: a GTM server-side container (a proxy you host and maintain) and Measurement Protocol tracking (your store's backend talking to GA4 directly). On Magento 2, the WeltPixel Google Analytics 4 PRO extension uses the Measurement Protocol as its primary server-side route, with GTM server-side container support available as a beta option for advanced setups. This guide walks the whole path: the client-side dataLayer and generated GTM container, enabling Measurement Protocol events, keeping the two from double counting, and the compatibility details that decide whether your setup works on day one, including Hyvä and the CSP changes Adobe shipped in 2.4.8 and 2.4.9.
Key Takeaways
- The extension's server-side tracking runs on the GA4 Measurement Protocol: purchases, refunds, checkout steps, and nine other event types sent server to server, with no dependency on the visitor's browser [5].
- The client side is not hand-built. The extension generates a GTM container JSON from your Magento configuration; you import it, and you must re-generate and re-import after any tracking configuration change.
- An unpublished GTM container is the most common reason "nothing tracks." Importing is not enough; the container has to be published.
- Client and server events overlap by design, so pick one dedup approach: pause the GTM tags for the events you track server-side, or let the extension automatically disable the dataLayer for those events.
- Refunds, admin-created orders, and orders that later leave an excluded status all reach GA4 server-side, and a dedicated order grid column shows exactly which orders were sent.
- Version support runs Magento 2.3.0 through 2.4.9 (PHP 8.5 supported since v1.17.0), with Hyvä covered by two zero-configuration compatibility modules on the PRO tier [4][5].
What does "server-side" actually mean on Magento 2?
Two architectures get sold under one label, and they behave nothing alike.
A GTM server-side container is a tagging server you provision, which receives events from the browser and forwards them to Google, Meta, or anywhere else. You own the infrastructure. The WeltPixel extension can generate a full container JSON for this setup, complete with the ecommerce tags, but the feature is explicitly in beta and aimed at advanced users who already have a provisioned server container and a configured client container pointing at it.
Measurement Protocol tracking is simpler and it is the extension's primary server-side path. Your Magento backend sends events directly to GA4 using a Measurement ID and an API secret from your data stream. No extra server, no monthly hosting bill, no proxy to patch. As of v1.17.3, the PRO version sends these events through the Measurement Protocol: purchase, refund, sign up, login, view item, view item list, select item, search, add to wishlist, add to cart, view cart, begin checkout, add payment info, and add shipping info [5].
Worth knowing before you compare vendors: Google added the Data Manager API as a newer server-to-server route and listed it in GA4's changelog as an alternative to the Measurement Protocol in May 2026 [3]. The Measurement Protocol remains fully supported and is still the established path for ecommerce event streams.
How the client-side layer works
Server-side does not replace the client side; it backs it up. The extension builds the client side around two pieces.
First, the dataLayer. Every ecommerce interaction, from view_item to purchase, is pushed in GA4's recommended event format, with prices and quantities as numbers and the ecommerce object cleared before each push.
Second, the generated container. Instead of asking you to build tags, triggers, and variables by hand, the extension generates a GTM container JSON from your Magento configuration under WeltPixel > Google Analytics 4 Ecommerce > JSON Export Options. You import that file into Google Tag Manager and publish.
Two operational rules follow from this design, and both come from how the generation works rather than from GTM itself:
- Re-generate and re-import after any configuration change. The JSON reflects your settings at generation time. Change a tracking option in Magento and the container in GTM is stale until you re-import.
- Publish the container. An imported workspace is a draft. Until you hit Publish in GTM, the storefront serves the old (or empty) container and no tracking fires. If you have ever imported a container on a Friday evening and spent Monday wondering why GA4 went quiet, this is usually the whole story.
One Magento-platform note belongs here. Payment pages have run Content Security Policy in restrict mode since 2.4.7 for PCI DSS 4.0 (other pages stay in report-only mode), and Adobe shipped GA-specific CSP fixes in both recent releases: 2.4.8 (April 8, 2025) allowed connections to region1.analytics.google.com so EU visitors stopped triggering CSP errors with GA enabled, and 2.4.9 (May 12, 2026) gave the Google Analytics module its own CSP whitelist, independent of the Adwords module [1][2]. If your tags worked on product pages but broke at checkout on an older patch level, CSP was probably the reason.
Setting up Measurement Protocol tracking
The client side ships in both the STANDARD and PRO versions. Measurement Protocol tracking is PRO only.
The path is Admin > WeltPixel > GA4 PRO > Enable Measurement Protocol Tracking Configuration. You will need two values from GA4 itself, both found on your data stream: the Measurement ID and an API secret. From there, the options that matter most in practice:
- Track Events selects which of the 14 event types go server-side. Purchase and refund are the usual starting point; many stores stop there and keep everything else client-side.
-
Client ID Fallback retrieves a client ID from the Google tag via gtag.js when the
_gacookie is not available, which keeps Measurement Protocol events flowing even when cookies are blocked. - Send User Provided Data attaches hashed customer data to the server-side purchase, GA4's enhanced conversions equivalent for the Measurement Protocol.
-
File logging writes every send to
ga4.log, and a debug endpoint option validates payloads against Google's debug collector before you trust the pipeline.
On consent: the extension logs the Consent Mode state alongside Measurement Protocol events for debugging attribution issues, and the GTM container plus frontend pixels honor whichever consent method you configure (Magento's cookie restriction mode or an external CMP). Consent setup on Magento is its own topic with 2026-specific stakes; the Consent Mode v2 guide covers the module side.
How do you stop double counting?
Enable Measurement Protocol purchases while the generated container still fires its client-side purchase tag and GA4 receives the order twice. The extension gives you two ways out, and you should deliberately pick one:
-
Pause the corresponding GTM tags. Keep the dataLayer intact but pause the tags for events you track server-side. Never pause the main
WP - GA4tag; it carries everything else. - Auto-disable the dataLayer for server-tracked events. A single setting stops the client-side push for any event you have enabled in Measurement Protocol tracking, no GTM edits required.
The second option is less to maintain. The first keeps client-side data flowing to any other tags that consume the same events, which matters once ad platform pixels enter the picture.
What does server-side tracking fix on a real store?
The concrete wins, per the extension's own documentation and features:
- Orders that browsers lose. Ad blockers and browser tracking restrictions do not touch a server-to-server call, and payment redirects that skip the success page stop costing you purchase events.
- Refunds. GA4 revenue that never gets corrected for credit memos overstates every downstream ROAS number. Refund events flow server-side with no browser involved at all.
- Admin and delayed orders. Orders created in the admin get tracked, and a cron job re-pushes orders that leave an excluded status later (a payment review that clears two days after checkout, for example).
- An audit trail. The Magento order grid gains a column marking which orders were sent through the Measurement Protocol, filterable, so reconciling GA4 against Magento sales reports starts from data instead of guesswork.
What it does not fix: a wrong currency setting, a consent banner that never grants storage, or a broken product feed still produce wrong numbers, just more reliably delivered. Server-side is a transport upgrade, not an audit.
Compatibility and the edge cases that bite
- Magento versions: 2.3.0 through 2.4.9 and all security patches [5]. PHP 8.5 and 2.4.9 support arrived in v1.17.0 (May 2026); composer is the only supported installation method [5].
-
Hyvä: PRO ships two compatibility modules (
module-hyva-ga4and a CSP companion) that work with zero configuration, and Hyvä Checkout is supported. Since the Hyvä theme went free and open source effective November 10, 2025 [4], this is no longer a niche concern; treat Hyvä compatibility as a requirement when evaluating any tracking stack. - Scale options: Redis caching for the tracking layer and multi-property sending (the same events to more than one GA4 property) are both available on PRO.
-
First-party delivery: the extension can generate a Cloudflare Worker for Google's tag gateway (
fps.goog), serving the Google tag from your own domain. The documentation labels it advanced and experimental, and warns against combining it with Cloudflare's built-in gateway feature. Try it after everything else works, not before.
For the wider decision of which integration approach fits your store, the older comparison at which GA4 integration is best for Magento 2 still frames the trade-offs; for building the GTM server container itself, start with creating a server-side GTM container.
FAQ
Do I need a GTM server-side container for server-side tracking on Magento 2?
No. The extension's Measurement Protocol tracking sends events from your Magento server directly to GA4 with no tagging server involved. The GTM server-side container JSON generation exists for stores that already run one, and it is a beta feature aimed at advanced users.
Will server-side events double count my purchases?
Only if you let both layers fire. Either pause the client-side GTM tags for events you track server-side or enable the setting that automatically disables the dataLayer for those events. Pick one approach and verify in GA4's DebugView.
What is the difference between the STANDARD and PRO versions?
STANDARD covers the full client-side setup: dataLayer, generated GTM container, and ecommerce reporting. PRO adds everything server-side (all 14 Measurement Protocol event types, refund tracking, the order grid column), plus enhanced conversions, Hyvä compatibility modules, and the nine ad and marketing platform integrations, each with a matching server-side API addon sold separately.
Does server-side tracking work when visitors decline cookies?
Events can still be sent, and the Client ID Fallback exists to keep them flowing when cookies are blocked. The extension logs the Consent Mode state alongside each Measurement Protocol event, so you can audit exactly what was sent and under which consent signals. Consent gating in the extension applies to the GTM container and the frontend pixels, through the consent method you configure.
Which Magento versions does this work on?
Magento Open Source and Adobe Commerce 2.3.0 through 2.4.9, installed via composer. PHP 8.5 support came with v1.17.0. On 2.4.7 and later, pay attention to checkout CSP settings; Adobe's 2.4.8 and 2.4.9 releases both shipped GA-related CSP fixes.
Server-side tracking is the difference between GA4 reporting what your visitors' browsers managed to send and reporting what your store actually did. If your Magento store runs on GA4 today, the WeltPixel Google Analytics 4 PRO extension adds the server-side layer to the setup you already have: 14 event types through the Measurement Protocol, refunds included, with the order grid showing exactly what was sent.
Sources
- Adobe Commerce 2.4.9 release notes, May 12, 2026, https://experienceleague.adobe.com/en/docs/commerce-operations/release/notes/adobe-commerce/2-4-9
- Adobe Commerce 2.4.8 release notes, April 8, 2025, https://experienceleague.adobe.com/en/docs/commerce-operations/release/notes/adobe-commerce/2-4-8
- Google Analytics, "What's new in Google Analytics" (Data Manager API entry, May 7, 2026), https://support.google.com/analytics/answer/9164320
- Hyvä, "Hyvä is going Free & Open Source," November 6, 2025, https://www.hyva.io/blog/news/hyva-is-free-open-source.html
- WeltPixel Google Analytics 4 User Guide, v1.17.3, August 3, 2026, https://docs.weltpixel.com/GA4/User-Guide-WeltPixel-Google-Analytics-4.html