Products that cover the topic Google Tag Manager GA4 for Shopify

Unsupported tag implementation detected on Shopify

 

"Your Google tag is running in a Shopify custom pixel. This may create duplicate measurement with your Google tag configured in the Google & YouTube app on your Shopify website."

 

You are not alone

Many Shopify merchants are getting this warning in their Google Tag Manager account and in this quick article, we're going to decompose it and possibly explain why it happens. 

 

Who gets this warning

This warning is often shown in Google Tag Manager if you run Shopify store and have installed Google Tag Manager through a third party APP or via Custom Pixel. If you're using the offical app recommended by Shopify and Google, this warning may not affect you.

 

What are Custom Pixels

Shopify are shifting towards more secure platform and in recent updates they removed any third party scripts that can be loaded in Checkout and Thank you pages. In the past, merchants were able to add scripts in .liquid files and have GTM installed on all pages including checkout. 

From security perspective however, this imposed risks of exposing sensitive information to third parties and Shopify acted by introducing Custom Pixels

 

 

 

Custom Pixels

Custom pixels are now the official way to add any Javascript code inside Checkout and Thank you pages but with some limitations. Custom Pixels run in an isolated environment (Lax Sandbox) in effect in a WebWorker with limited acces to window and document objects. They can load scripts and subscribe to events dispatched by Shopify Analytics API however they can't access DOM elements from the pages. They are entirely dependent on events dispatched by the Analytics API and the payload available with these events. 

Analytics API is dispatching a few custom events which Custom Pixels can read: 

  1. payment_info_submitted
  2. checkout_address_info_submitted
  3. product_added_to_cart
  4. checkout_started
  5. checkout_completed
  6. product_removed_from_cart
  7. cart_viewed
  8. product_viewed
  9. collection_viewed

 

By hooking to these events a Custom Pixel can load gtag.js() or Google Tag Manager and push data to dataLayer[] object and in effect implement tracking for Checkout and Thank you pages.

 

The problem and why you see this warning in Google Tag Manager 

Wrong parameters

Due to running in sandboxed environment and inside a WebWorker, according to Google, Custom Pixels may impose data loss for some events and parameters that depend on signals from outside the sandbox.

For example, if you've installed GTM and then installed Meta Pixel via custom HTML tag, it will run fine however a few parameters may get incorrect values. Such parameter is the &dl (Document Location) parameter.

Because GTM is now running inside a WebWorker, the &dl parameter will not get the URL of the Checkout Page but will get the URL of the WebWorker e.g. 

 

Impossible to PREVIEW GTM 

WebWorkers are running on separate thread from the Main thread. This is where your web page’s UI and regular JavaScript code run. It handles rendering, DOM updates, user input, etc.

Being loaded inside separate thread, the GTM preview window does not have access to DOM elements from the main thread and it will not load the preview window, it will also not connect correctly to GTM Debug Preview.

 

Am I doomed and using recommended Google App is the only option?! 

Absolutely NOT!

In our experience running GTM inside a Custom Pixel works perfectly fine especially combined with an App Pixel (this is another type of pixel available to Shopify Apps). 

Google care for their customers and the reason that they display this warning is that customers and merchants are often not aware how Custom Pixels work and if they are not properly implemented they might end up losing data. Therefore they decided to display this warning for all of those non-techie merchants who don't want to deal with Custom Pixels. 

 

The PARADOX

Yes, there is a paradox here. Let me explain. We got into thinking, if Shopify have removed any scripts from checkout and they don't offer built-in tracking and still rely on app (be it native), it still has to use the same approach and use a Custom Pixel itself and this turned out to be true. 

The native app recommended by Shopify and Google is using a Custom Pixel itself. Their custom pixel is loading gtag().js and pushing events just as any other Custom Pixel from any app in Shopify.

Therefore we believe that if you're using trusty third party APP for Shopify or you're confident that you have implemented your Custom Pixel properly, this warning can be ignored. For all other users, we'd recommending sticking to Google's official app for Shopify to ensure correct imlementation.

 

The Verdict

If you are not a developer and don't want to risk using wrong Custom Pixel implementations, we highly recommend using the native app from Google and Shopify for Google Analytics tracking.

If you are a developer or have a trustworthy partner to implement a Custom Pixel for you, we feel that benefits outpace any disadvantages. You can run GTM, you can run Meta Pixel, you can run Conversions API (via APP pixels), you can run server-side tracking (via APP pixels), you can implement virtually any platform via Google Tag Manager. Last but not least, the native app is kind of limited in terms of the events that it tracks. 

 

Extensions for Magento

Anowave is an extension developer for Magento 1.x and Magento 2.x platforms. We provide a wide range of premium extensions for our in-house and public clients. The extensions we offer extend the capabilities of Magento and provide bespoke functionality. They also fill some gaps in the functionality provided by the base platform and help customers choose Magento as their preferred eCommerce platform.

The extensions we offer are part of our full-range Magento service, which also includes a Premium Helpdesk where customers can speak with actual software engineers and have their issues resolved without hassle. Premium-labeled modules also include free installation, configuration, testing, etc.