Testing Steps (#2) no longer work for "Create a Google Tag Manager custom pixel"

https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/gtm-tutorial

Steps:

  1. Open your Shopify store in a Chrome browser.
  2. Add the Google Tag Assistant Legacy Chrome extension to your browser.
  3. Click the extension icon, and then click Enable.
  4. Navigate to your site, and then trigger the events that you want to test.
  5. In the extension, click the on the Google Tag Manager tag. The Data Layer section should display the payload of the event that was triggered.
  6. Any other tags that are loaded by Google Tag Manager are also listed in the extension. You can click these tags to review the data that was sent to them.

Hi Zamartz,

I’ve flagged this to the Help Docs team - but in future, for feedback on the merchants docs I’d recommend reaching out to support directly to flag content issues.

ticket number 54760956

Thanks! The helps docs team will update this!

The tutorial and testing instructions are now updated.

1 Like

I couldn’t help but laugh (and grimace) at this ‘update.’ It’s as if Shopify is saying, ‘Here’s a glimpse of our event—enjoy watching it, but if you’re relying on GTM, good luck!’ It feels like a half-measure that leaves us high and dry rather than offering any alternative solution. :rofl:

Hi Zamartz, the Shopify pixel helper will tell you which events were subscribed to properly by your GTM custom pixel and let you know about runtime errors.

To understand what GTM is doing after receiving the event from Shopify, there are a couple options. You can use the tag assistant to tell you which Google tag are loaded by GTM, there are chrome extensions for the specific pixel you are tracking (Facebook, TikTok, etc) or you can look at specifc network calls in the dev console. In the update, the link to the Shopify pixel helper pages has more detailed instructions on different ways to test your custom pixel.

@Dave_Strang sorry for coming in there so hot, but both Google and Shopify haven’t been particularly helpful on anything between the two.

Sadly for GTM there is no “test mode” so while we can put tiktok, google analytics, pinterest… etc… in test mode and see the data capture on their sides the sandbox and removal of legacy tag assist knee-capped the ability to do any real QA with GTM though shopify. It’s working in the dark now.

Hey @zamartz , I appreciate your feedback and agree that debugging GTM in a sandbox is not easy.

Since the release of custom pixels, Shopify invested in the debugging problem by building the Shopify pixel helper which will let you know if your custom pixel loaded properly and if the events were subscribed to properly.

To get visibility into what is happening between GTM and the pixels/tags GTM is loading, I’d recommend look at the network activity. You will be able to see if GTM loads the pixel/tag via the dataLayer.

In the example above, the green dot in the Shopify pixel helper indicates the event was successfully delivered to the sandbox. You can open the chrome developer tools and look at the network tab. Search for “datalayer” and you’ll be able to see activity related to it. In the example, it shows that GTM is loading a gtag.

Alternatively, you can add console.log to your pixel code to see where errors occur. For example, place a “console.log” in your code after a data layer push is complete. If it show up in the console log while test, you know that piece of code executed.


In the screenshot above, the green dot on the shopify pixel helper shows that the “checkout_completed” event was successfully subscribed to and was received by the sandbox without runtime errors. In the console log, the string “check_completed_pushed_to_dl” indicates that the code above this in the custom pixel executed without error.

I admit that if “test mode” worked with the sandboxed custom pixel, debugging would be much easier. Shopify invested in trying to make test mode work but we were unsuccessful in finding a solution that didn’t compromise the security of the sandbox.

I hope the above helps with your debugging of GTM in the custom pixel.

1 Like

@Dave_Strang that is certainly interesting but it’s not what we need really. GTM side shows what tags were able to use that data, if they were missing details for a specific tag and more… just knowing what event pushed isn’t enough.

You can see details here: Understanding GTM Events 📊 | Loom

@Dave_Strang adding to what @zamartz has mentioned, even following your approach from the test view of Shopify, when firing a custom DataLayer event, it is not registering on the console. we can see it in the fired events on Shopify but not the console.

1 Like

@Joey_Azar the dataLayer array is not available on the top frame in this case, only inside the pixel sandbox (Iframe) it is being used.

It is still possible to interact with it in the dev tools’ console, but the right JavaScript context needs to be selected.

The other option is to use console.log calls whenever you’d like to debug a value. As suggested by @Dave_Strang in his reply.

1 Like

HI all - again, not what we are after

Hi Zamartz,

I understand that this may not meet your needs, but as previously mentioned, Tag Assistant is not fully compatible with custom pixels.

Many of our largest brands successfully utilize GTM with custom pixels, and they inspect network calls to debug their GTM tags. I’ve done this myself, and while it can be effective, it’s a tedious process and lacks the comprehensive insights provided by Tag Assistant.

Shopify is actively advocating for Google to make their tool compatible with custom pixels, but unfortunately, it hasn’t been prioritized.

Google will recommend that you do not use GTM in custom pixels and instead use their Google and YouTube app and other apps in the Shopify app store.

If you can’t live without tag assistant for debugging, I would recommend you look at alternatives to GTM on Shopify.

Regards,
Dave

Totally hear you dave. Everyone wants their own thing to work their own way.

Normally I’d say fine and rely on the big companies of Shopify and Google to play well together with their “official apps” but that is the other problem. The app doesn’t play well either and is limited to previous functions.

For instance, discounts not working with native app = Re: GA4 not registering discount code in Shopify - Shopify Community

We are all at the mercy of SHOP/GOOGLE and we have to just see where the wind blows.

1 Like

Thanks for the feedback, Zamartz.

The discount bug is something I might actually be able to help with. I sent it over to my Google counter part and will report back on the other tread what I find. Thanks for pointing it out.

2 Likes

any update on this? I’m not seeing past comments…

Hi @zamartz - we are close to a resolution. The subtotalPrice field includes both line-item and order level discounts on the old Thank-you page. On the new Thank-you page, the subtotalPrice field only includes line-item discounts.

The current plan is to make a change so the subtotalPrice field is consistent and includes both order-level discounts and line-item discounts on both TYP.

Let me know if this makes sense from your perspective.

1 Like

A. that would work at the order level for sure
and the other issue:

B. where the discount amount nor code/name are being sent on the order

C. discounts are also not showing on the product itself when it’s a line vs discount?

@Dave_Strang my friend - any updates here? :slight_smile: