Shopify Custom Pixel sending duplicate view_item to GA4 with sandbox URL (ec_mode=m) — anyone solved this?
I'm running a Shopify store with a Custom Pixel (based on the Loves Data template) sending events to GA4 via GTM. I'm seeing an unusually high amount of Unassigned traffic in GA4 (typically 38–75% depending on the day), and after several days of debugging I've narrowed the issue down, but I can't identify what's generating one specific hit.
What I'm seeing
For every product page view, GA4 receives three hits:
- ✅
view_itemwith the correctdl=https://mysite.com/products/... - ❌
view_itemwithdl=https://mysite.com/web-pixels/.../sandbox/...andec_mode=m - ✅
page_viewwith the correct product URL
The two view_item hits have:
- same
tid - same
cid - same
sid - same product
- same ecommerce payload
The only meaningful differences are:
dl(real product URL vs sandbox URL)ec_mode=mappears only on the sandbox hit.
What I've already verified
- Added
client_idandreferrerto every event in the Custom Pixel. - Configured cross-domain measurement (
myshopify.com,checkout.shopify.com,shop.app). - Changed
event.context.document.location.hreftoevent.context.window.location.hreffollowing Shopify's documentation (no change). - Reverted
send_page_view = falseafter it caused engagement issues. - GTM contains:
- 1 Google Tag (triggered by
shopify_page_view) - 1 GA4 Ecommerce Event tag
- 1 GA4 User Data tag
- 1 Google Tag (triggered by
The Ecommerce tag uses Send Ecommerce Data and page_location is populated from a Data Layer Variable containing the correct product URL.
My question
At this point, it doesn't look like the Custom Pixel is generating the sandbox URL, because changing the pixel made no difference.
Has anyone seen this exact pattern where a second view_item is sent with:
ec_mode=m/web-pixels/.../sandbox/...aspage_location
If so:
- what component generated that second hit?
- was it the Google Tag, GTM, Shopify Web Pixels, or something else?
- were you able to stop it?
I'm mainly looking for someone who has already debugged this specific Shopify + GTM + GA4 Web Pixels behavior.
Thanks!