I’m working on a Shopify setup using Stape’s Shopify event tracking plugin, client-side GTM and server-side GTM hosted via Stape.
The setup is generally working correctly. Data Tags are sending ecommerce events to the server container, and Meta CAPI deduplication is already in place.
I’ve added a custom event data field called marketing_channel to the Stape Data Tags. The channel value is detected client-side, stored in a first-party cookie called marketing_channel, then read back using a GTM Custom JavaScript variable and passed into the Stape Data Tags. Values are things like organic_google, meta, awin, attentive_email, etc.
For normal storefront events, this works as expected.
For example, add_to_cart, page_view etc sends:
marketing_channel = organic_google
and I can see this received correctly in the server container.
The issue is with the purchase event.
I can’t see anything client side presumably because of the pixel sandbox issues we have with Shopify these days.
The purchase event is received server-side, and other event data is present, including customer/order fields, but marketing_channel comes through as undefined.
The purchase Data Tag has “Add Common Cookie” enabled.
I also changed the marketing_channel row in the Data Tags from “Store: None” to “Store: Everywhere” across the relevant Data Tags, but the purchase event still receives marketing_channel as undefined.
So the issue appears to be that the custom field is available and sent for normal storefront events, but it is not being carried into the Shopify purchase/checkout event context.
Does anyone lknow the correct way to persist and pass a custom field such as marketing_channel from a cookie into the Shopify purchase event?
Specifically:
-
Should custom Data Tag fields stored as Everywhere be included in the Common Cookie payload?
-
Does “Add Common Cookie” only include specific Stape/common cookies rather than custom fields?
-
Is there a recommended way to add a custom cookie or custom event field so it is available on the purchase event?




