What's your biggest current challenge? Have your say in Community Polls along the right column.

Re: Shopify Custom Pixel is incompatible with Google Ads conversions (bug report)

Shopify Custom Pixel is incompatible with Google Ads conversions (bug report)

PatrykTucki
Shopify Partner
3 0 10

Hello everyone,

 

I would like to report a bug related to Web pixel extension API, and more precisely to "Custom web pixels".

 

The problem is that Google Ads conversion exports are not working in the "Custom web pixels" environment.

 

Here's an example code snippet that loads gtag.js script and exports a single Google Ads conversion:

 

// Load gtag.js script.
const script = document.createElement('script'); script.src='https://www.googletagmanager.com/gtag/js?id=AW-587263117'; script.async = true; document.head.appendChild(script);
// Configure gtag.js script. window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'AW-587263117');

// Export Google Ads single conversion. gtag('event', 'conversion', { 'send_to': 'AW-587263117/vEM1COuix84YEI3Zg5gC', 'value': 1.0, 'currency': 'DKK' });

 

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:

 

1. https://reaktionteststore.myshopify.com/ (password: admin123)

 

This store uses the above code snippet in theme.liquid file. The conversion is successfully exported.

scrnli_09_08_2023_09-37-43.png

 

2. https://reaktion86.myshopify.com/ (password: admin123)

 

This store uses the above code snippet in "Custom web pixels" feature. The conversion is NOT exported.

scrnli_09_08_2023_09-37-45.png

 

Best regards,

 

Patryk Tucki

 

Replies 22 (22)

EmmanuelFlossie
Shopify Partner
3465 264 834

I have the same issue, the Shopify Pixel is not working.

Get in touch with Emmanuel: a Google Shopping Specialist, Google Ads Diamond Product Expert, and also a a Google Product Expert Education 2021 & Tailwind 2023 Award winner.
Need Google Merchant Center or Google Shopping support?.

pashadev
Shopify Partner
7 0 2

We are having the same issue.

Did you guys find the solution?

Mikkel-Rosener
Shopify Partner
1 0 0

Sadly not yet

Fischeren
Shopify Partner
1 0 0

I'm having the same issue as well.

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)

pashadev
Shopify Partner
7 0 2

This is what we did for now 😞

weotch
Shopify Partner
24 0 12

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.

jpallard
Shopify Partner
1 0 0

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! 

Dave232
Shopify Staff
2 0 1

Hi, Google shipped a fix for this last week. 

 

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.

Dave | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution

weotch
Shopify Partner
24 0 12

Thanks for the update @Dave232! I can confirm that we're seeing conversions again now.

maka_veli
Shopify Partner
2 0 0

How did you manage to connect Google ads conversion scripts inside Custom Pixel? If possible, please share an example of your code

weotch
Shopify Partner
24 0 12

I'm using the "Google Ads Conversion Tracking" GTM tag.  And I'm loading GTM via a Custom Pixel similar to what's described here: https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/gtm-tutorial

pashadev
Shopify Partner
7 0 2

Could you please share the code you are using here?

Dabrowka
Tourist
18 0 1

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?

pashadev
Shopify Partner
7 0 2

Hi @Dave232  

 

Great news!!

Thank you very much for the update.

Google events tracking is working inside the custom pixel now.

 

thenuelook
Tourist
5 0 5

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.

mrcardenosa
Shopify Partner
3 0 2

Hi all, are there any news on this? Is google ads working?

 

Thanks

 

Miguel

pashadev
Shopify Partner
7 0 2

Yes. Google ads pixels are working now.

Weblinko
Shopify Partner
1 0 2

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 ?

jfroelich
Shopify Partner
2 1 2

I ran into the same thing. This took several hours to figure out but I got something working:

gtag('config', 'AW-1234', { allow_interest_groups: false });

Do not use the common config for all properties, you have to pass this config specifically to this property, there is a hidden error if you use irrelevant config properties for AW properties that you can only see in the console logs of the deprecated google analytics debugger chrome extension. If there is an error in the config, the AW config is ignored, as if you had not configured anything, no matter what properties you try. Do not naively reuse the GA4 config for the AW config. Do not use the common config call. Make two separate specific config calls and specify a specific property id as the second parameter each one, then only specify the relevant properties in the AW one.

 

After doing this (while having GTM setup in an iframe Shopify custom web pixel with an AW property also receiving events via send to), I no longer see the promise rejection from joinAdInterestGroup.

Brndyjms
Shopify Partner
2 0 0

This worked, thank you! 

Jakewillis
Shopify Partner
1 0 0

Adding my 2 cents, I have imported GA4 conversions that I have as secondary (back up events)

I switched these to primary because they seem to be capturing more data right now.

flo3393
Excursionist
32 2 6

So you have build some customer events that are sending successfully conversion events so GA4? If yes, can you provide this here ? 🙂