How to Fire Affiliate and Partner Tags From the GA4 Extension's dataLayer on Magento 2

|Dan Giura
How to Fire Affiliate and Partner Tags From the GA4 Extension's dataLayer on Magento 2

TL;DR

A partner tag in Google Tag Manager can fire on the same purchase event the GA4 extension pushes for GA4. One PRO Measurement Protocol option, already at Yes when it appears, stops that push for every event you also send server-side, and every GTM tag listening for it stops too. GA4 keeps its purchases through the server, so only the network's report shows the loss. Pause GA4's duplicate tags, then switch the option off.

Key Takeaways

  • Check Track Events first: the purchase push disappears only on PRO, with the Measurement Protocol on, Purchase selected there and the dataLayer-disable option at Yes [1].
  • The option is one switch for every event in Track Events, so setting it to No means pausing each duplicated GA4 client-side tag in GTM, never WP - GA4 [1].
  • Fire the partner tag on a Custom Event trigger for purchase, because a Page View trigger can run before the order data is there [2].
  • Read ecommerce.transaction_id, ecommerce.value, ecommerce.currency and ecommerce.coupon with Version 2 Data Layer Variables [4] [5], and treat an empty coupon as no coupon [1].
  • Build a different commission base in GTM, leaving the GA4 value settings alone [1].
  • Match the network's conversions to Magento orders by order number for a week; admin orders never reach a browser tag [1].

What removes the purchase dataLayer push?

The affiliate network's conversions fall off from one day to the next, GA4 revenue for the same days doesn't move, and nobody touched the partner tag. That pattern points at a save in the extension's Measurement Protocol settings on the day the drop starts.

With the PRO Measurement Protocol, the extension sends purchase and other events to GA4 from your server, and a purchase also sent from the browser would count twice [1]. The guard is a setting in the Measurement Protocol Tracking Configuration, Automatically disable data layer for enabled measurement protocol events, and its admin note says that with it on, "even existing GTM tags will not fire because the data layer is not sent" [1]. Mapping Magento 2 store views to GA4 properties applies that rule to GA4 tags across containers.

"Existing GTM tags" includes tags that have nothing to do with Google. An affiliate conversion tag on the purchase trigger reads the same push GA4's client-side purchase tag reads, so when the push stops both tags stop, and only GA4 has a server-side copy of the order.

All three conditions have to hold [1]:

Condition Where to check
Enable Measurement Protocol Tracking Configuration is Yes (PRO) Admin > WeltPixel > GA4 PRO
Purchase is selected in Track Events The same Measurement Protocol section
The dataLayer-disable option is Yes The same section, visible once the Measurement Protocol is on

The option appears only after you switch the Measurement Protocol on, and when it appears it's already set to Yes. So the save that turns on server-side purchases also turns off the browser push, and nothing on the screen mentions partner tags. The Measurement Protocol is a PRO feature (GA4 Standard vs PRO), so Standard stores can't switch this option on.

Keep the push: turn the option off and pause GA4's duplicate tags

The guide describes the other route. In Google Tag Manager, pause "each client side event that is also enabled under Track Events", and don't disable "the main Analytics Tag, labeled WP - GA4" [1]. GA4 then gets each purchase once, from the server, and the purchase push stays in the dataLayer for every other tag. Our comparison of client-side GTM and server-side tracking presents the two routes as equal ways to deduplicate GA4, and for GA4 they are. For a partner tag, only the pause route keeps the push.

Because the option is a single switch, No brings back the push for every event in Track Events, and each needs its GA4 client-side tag paused. Do it in this order:

  1. In GTM, open Tags and pause the GA4 event tag for every event selected in Track Events. Leave WP - GA4 running [1].
  2. Publish the container.
  3. In the extension, set Automatically disable data layer for enabled measurement protocol events to No, save, and flush the Magento cache.

The GTM step goes first because the moment the option reads No with the GA4 event tags still live, every selected event reaches GA4 twice.

If no tag besides GA4 needs these events, leave the option at Yes; it's the duplicate guard added in v1.11.9 (October 7, 2022) [1].

Build the partner tag on the purchase event

The extension's v1.12.1 (May 30, 2023) refactor aligned its events with Google's recommendations [1], and the container it generates already listens for them. A partner tag goes in next to them:

  1. Triggers > New > Custom Event, with the event name purchase [3].
  2. Variables > New > Data Layer Variable, Version 2, which reads dots as nested keys [4], one per key below.
  3. The partner's tag (their template, or a Custom HTML tag with their snippet) on that trigger, variables mapped to the network's fields.
dataLayer key What it holds Typical partner field
ecommerce.transaction_id The order number you see in Magento Order ID
ecommerce.value The order value, per the extension's GA4 value settings Sale amount
ecommerce.currency Base or display currency, per Currency And Amount Scope Currency
ecommerce.coupon The coupon code, or an empty string Voucher code
ecommerce.tax, ecommerce.shipping Tax and shipping amounts Commission base adjustments

These are the keys Google documents for the GA4 purchase tag [5]; confirm each on your own success page before you map it.

The trigger matters because the extension clears the ecommerce object with {ecommerce: null} before every ecommerce push, a v1.11.1 (April 25, 2022) change that follows Google's recommendation [1] [5]. Google warns that values pushed by page code "are not guaranteed to be available for the next event", and tells you to "add an event name to a message as it is pushed to the data layer, and then listen for that event name with a Custom Event trigger" [2]. A Page View trigger on the success URL can fire the partner tag before the order object exists. The Load dataLayer before GTM Container switch is a troubleshooting option for "tags that are set to fire on a Page View trigger" [1], and it isn't the fix for a partner tag.

On PRO, a multiple-address checkout pushes one purchase per order generated (since v1.12.7, July 26, 2023) [1], so the partner tag fires once per order.

Which order values will the partner tag read?

The partner tag reads what GA4's client-side tag would, so it inherits the extension's GA4 value settings [1]. Order Success Page Total Calculation picks Subtotal or Grandtotal, Exclude Tax From Transaction and Exclude Shipping From Transaction take tax and shipping out, and Currency And Amount Scope chooses base or display currency.

If the program pays commission on a different base, compute it in GTM; changing the extension setting would change GA4 revenue too. When the value includes shipping and the program pays on the order before shipping, a Custom JavaScript variable that subtracts ecommerce.shipping from ecommerce.value does it.

Since v1.12.7 (July 26, 2023) the coupon field in the extension's dataLayer is an empty string when no coupon applies [1], so a tag that credits partners by voucher code has to treat "" as no code.

Two more settings decide which orders the partner tag sees at all: Exclude Orders with 0 Value and Exclude Orders By Status stop the purchase event for the orders they catch [1]. Expect no purchase push for those orders on the success page either, and check both before you reconcile.

Does the cookie banner hold the partner tag back?

Yes, because the partner tag lives inside the container. With the extension's default consent method and Magento's Cookie Restriction Mode on, "GTM loads only after the user accepts cookies" [1], the gate our GTM container guide covers. A shopper who hasn't clicked Allow by the time the success page loads gets no container on that page, so no partner tag fires for that order.

With External CMP, "GTM always loads, and the CMP handles consent via Google Consent Mode v2" [1]. Google's own Ads, Analytics and Floodlight tags carry built-in consent checks; a partner tag's Additional Consent Checks start at "Not set: Default. No additional consent checks are performed by this tag" [6]. To make a partner tag check consent, open its Advanced Settings > Consent Settings, choose "Require additional consent for tag to fire" and add the consent types; the tag then fires only "if the status of all specified consent types are 'granted' when the tag is triggered" [6].

The server-side GA4 purchase follows its own rule: since v1.17.4, with Require Visitor Consent for Server-Side Events switched on (it's disabled by default), the extension gates the GA4 Measurement Protocol on the shopper's Consent Mode v2 choice [1], as our guide to server-side events and consent explains.

What a browser tag can't see, and where a postback fits

A GTM partner tag fires only in the shopper's browser, on the success page, with the container loaded. Some orders never get there:

  • Orders created in the Magento admin, phone orders included. On PRO the extension sends those to GA4 as a server-side purchase (since v1.12.5, July 5, 2023) [1], and no shopper's browser loads a success page for them.
  • On Cookie Restriction Mode stores, orders from shoppers who hadn't accepted cookies when the success page loaded.
  • Shoppers whose browser blocks the GTM container.

You've probably noticed that the network's count and Magento's order grid never agree to the order, and these three cases are where to look first.

A server-to-server postback covers those blind spots. The network appends its click ID to the landing URL, your store keeps that ID with the order, and your server reports the order to the network afterward. It's a separate integration, built by the network or a developer; the GA4 extension has no affiliate or postback feature. Run it alongside the browser tag, and ask the network how it deduplicates an order that both report.

How do you confirm the tag fires for a real order?

Run this before a promotion week:

  1. In Admin > WeltPixel > GA4 PRO, open the Measurement Protocol settings. Note whether Purchase is in Track Events and what the dataLayer-disable option says.
  2. Set Enable dataLayer frontend Preview/Debug to Yes, limited to your own address with IP Address Restriction [1]. Place a test order and open the preview window on the success page. You should see a purchase event whose transaction_id is the Magento order number.
  3. Open GTM Preview on the same checkout. On the purchase event, the partner tag should show as fired with the order number, value and currency.
  4. For a week, export the network's conversions and match them to Magento orders by order number.

Admin orders and declined banners explain an expected gap; a drop that starts the day someone saved the Measurement Protocol settings points back at the dataLayer-disable option.

FAQ

Does the GA4 extension send conversions to affiliate networks?

No. It pushes ecommerce events into the dataLayer and, on PRO, sends GA4 events through the Measurement Protocol [1]. A partner tag in GTM or a postback reports the order to the network.

Will setting the option to No double-count purchases in GA4?

Yes, if the GA4 client-side purchase tag is still running. Pause the GA4 tag for each event in Track Events first, and keep WP - GA4 running [1].

Can I keep the option on and still fire the partner tag from the dataLayer?

Not from the purchase event, which the option removes along with every other event in Track Events [1]. A postback is the route that doesn't need the push.

Keep the purchase push your partner tags need on the Magento 2 Google Analytics 4 extension, and move only GA4's own purchase to the server.

Sources

  1. WeltPixel Google Analytics 4 User Guide and Change Log (Measurement Protocol Tracking Configuration; General configuration; change log v1.11.1 to v1.17.4), retrieved October 14, 2026, https://docs.weltpixel.com/GA4/User-Guide-WeltPixel-Google-Analytics-4.html
  2. The data layer, Google Tag Manager developer documentation, last updated October 13, 2026, retrieved October 14, 2026, https://developers.google.com/tag-platform/tag-manager/datalayer
  3. Custom event trigger, Tag Manager Help, retrieved October 14, 2026, https://support.google.com/tagmanager/answer/7679219
  4. User-defined variable types for web, Tag Manager Help, retrieved October 14, 2026, https://support.google.com/tagmanager/answer/7683362
  5. Measure ecommerce (Tag Manager), Google Analytics developer documentation, last updated August 19, 2026, retrieved October 14, 2026, https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtm
  6. Tag Manager consent mode support, Tag Manager Help, retrieved October 14, 2026, https://support.google.com/tagmanager/answer/10718549

Ready to upgrade your tracking?

Server-side tracking for Magento and Shopify — accurate data, better attribution, full privacy compliance.