Help with migrating Google tags with the Google & YouTube app on Shopify

Hello, I’m looking at Google’s Tag Migration article and having a hard time figuring out what it means for my store. I got a custom pixel where I listen to the checkout_completed event, and set some data into window.dataLayer. That data includes stuff like order line items, product tags, customer tags. Those tags are fetched from Storefront API. So that’s data that’s not available in the checkout_completed event, or in the automatically tracked Google Analytics event.

So my question is how do I migrate Google tags with the Google & YouTube app on Shopify while maintaining having some custom data in my checkout_complete analytics? If I’m reading the docs right, I should stop setting Google Analytics data to window.dataLayer in custom pixel but I have no idea how to keep feeding the custom data to analytics on checkout_complete.

Thanks in advance!

Thank you for your response! Yeah that makes sense. So did I get it right, my Custom Pixel should be something like this:

// load GTM script
(function (params) {
   // load gtm script from https://www.googletagmanager.com/gtm.js
})(params);

analytics.subscribe('checkout_completed', async (event) => {
   window.dataLayer.push({
      event: "My Custom Checkout Event",
      ...data
   })
})

And then I’ll just configure Google Analytics to listen to “My Custom Event”.