A critical incompatibility exists between Shopify’s Custom Web Pixels feature and Google Ads conversion tracking. The gtag.js script loads successfully within Custom Pixels but fails to export conversions, while the same code works properly when implemented directly in theme files.
Root Cause & Resolution:
Initial issue stemmed from cross-domain restrictions in the Custom Pixel sandbox environment preventing gtag.js from loading via googletagmanager.com
Google shipped a fix addressing the Ads tag’s inability to correctly detect sandboxed iframes
Conversions are now being captured successfully for most users
Ongoing Issue:
A new error has emerged: Failed to execute 'joinAdInterestGroup' on 'Navigator' from td.doubleclick.net. One working solution involves disabling interest groups:
When this script is used within “Custom web pixels” feature, the gtag.js script is loaded, but the conversion is NOT exported.
When this script is used within a theme, the gtag.js script is loaded and the conversion is successfully exported.
It means that the sandbox environment used by “Custom web pixels” feature prevents the gtag.js script from exporting Google Ads conversions. This is a critical issue, since Google Ads is the most popular marketing platform and “Custom web pixels” feature is here to faciliate integrations with marketing platforms.
I would like to report this issue to the Shopify support team. In order to make debugging this problem easier, I created two test stores that illustrate this problem:
How did you end up working around this issue? Did you just scrap the custom pixels for now and go back to the old way of doing it? (installing in the theme code & addtional scripts for checkout)
We are also experiencing this. I reported it to Shopify Plus customer report and they asked me to reach out to Google instead. I did this and, as you would expect, they basically said that it’s a Shopify issue.
I’ve tried implementing the conversion as both a GTM “Google Ads Conversion Tracking” tag as well as an HTML tag, like in the original post.
What is confounding to me about this issue is that I don’t see any errors in the console from either tag approach though I do see the tags being rendered in the DOM. Instead, there is just a lack of the expected network requests to googleadservices.com and doubleclick.net.
Like @pashadev , we’re also going to workaround by implementing through Additional Scripts.
You can’t load gtag.js within a pixel event. It’s trying to get it through googletagmanager.com, and it’s hitting a cross-domain restriction within the sandbox environment.
One way to do it is to send the data to the main window using postMessage, catch that, then trigger your event within the theme itself. The top window doesn’t have this restriction in place. Small guide to do that here: https://jpallard.com/en/using-shopify-customer-events-for-analytics/
There are other ways to do it if you use server GTM, but that’s the quick and dirty way!
The Ads tag code was attempting to read the document location from the top level window because it’s not correctly detecting that the iframe it’s within is sandboxed.
You should be seeing conversion captured on the ads side now.
It looks like there is a new issue. We are now seeing the following error in the Google Ads custom web pixel we’ve been using for conversion tracking:
Uncaught (in promise) DOMException: Failed to execute ‘joinAdInterestGroup’ on ‘Navigator’: May only joinAdInterestGroup from an https origin.
at https://td.doubleclick.net
Is anyone else seeing the same thing? From Googles documentation it seems like running this in a sandbox is unsupported.
We’re still seeing the following error in the Google Ads custom web pixel we use for conversion tracking.
Uncaught (in promise) DOMException: Failed to execute ‘joinAdInterestGroup’ on ‘Navigator’: May only joinAdInterestGroup from an https origin.
at https://td.doubleclick.net
Unfortunately, we have not yet found a solution to correct this problem.
Has anyone found a solution ?
Hi Weotch, so I create a conversion linker and google ads conversion tracking tag inside the GTM and publish it and that’s it? I don’t need to add anything to the pixel? How did you implement the google dynamic remarketing?