Storefront and GTM at checkout

Hi everyone,

A short introduction: we have multiple websites developed with a headless approach, integrating with Shopify through Storefront APIs, and redirecting customers to the Shopify checkout page to complete their orders.

We used to track customers during the checkout process by injecting Google Tag Manager (GTM) into the checkout.liquid template. On our main website, we use Iubenda to obtain customer tracking consent, and we also inject Iubenda through GTM during the checkout.

Now, here’s the issue: starting from August 13, 2024, the checkout.liquid template will no longer be editable, and we are searching for solutions to migrate the functionality we had in the template. We’ve managed to convert most of it, except for the GTM code injection. We attempted to implement a Custom Pixel, which works well for analytics tracking, but it doesn’t handle the Iubenda banner due to the Pixel code running in a sandbox environment that restricts such actions.

So, here’s the question: how can we maintain Iubenda consent as we switch from the main website domain (e.g., xxx.com) to the Shopify checkout domain (e.g., checkout.xxx.com) and continue tracking custom events in conjunction with the customer’s consent choice?

Thank you

Actively working on the same problem. Have you found any solution to this? :eyes:
We have the same setup with XXXX

Nope, still waiting for an answer from both Shopify and Iubenda… If you figure out how to solve this please share with me :folded_hands:

Thank you!

I will. What I’ve been able to find out is that this might have something to do with GTM running in a JS sandbox.
I haven’t been able to debug it, which is a major issue. We need to be able to QA and test before pushing changes to tracking and events live.
Currently the Google Tag Assistant Legacy is able to recognise the correct GTM, but we’re not seeing the data being processed in DataLayer nor does our custom events relying on events like “begin_checkout” trigger correctly.
I hope to get a clear “Working on it” or “Here’s how it works” from the Shopify team.

We have a headless implementation. Since the domain we’ve had for years cannot be the same as the Shopify checkout, we had to create shop.website.com. When trying to connect to the Google Merchant Center, it immediately disapproved all of our products because the PDPs use the original domain URLs that do not include “shop”. I’m a bit at a loss. I reached out to Google thinking I could create subdomain in the MC, but they said it wasn’t possible. Anyone have any suggestions?