Issue with detecting checkout_completed event using Web Pixel app extension

fooc
Shopify Partner
4 0 5

Hello everyone,

 

I am currently developing a Web Pixel app extension.

I have implemented the subscription to the checkout_completed event, but I am experiencing inconsistent detection of this event, even when using the same environment and following the same steps to complete a purchase.

 

I have followed the implementation guide provided in the Shopify documentation:(https://shopify.dev/docs/apps/marketing/pixels/getting-started)

Here is an example of the code I am using:

import { register } from '@shopify/web-pixels-extension'

register(({ configuration, analytics, browser, settings, init }) => {
  analytics.subscribe('checkout_completed', async event => {
    console.log('checkout_completed:', event)
  })
})

I am using the latest version of `@shopify/web-pixels-extension`, which is currently 0.4.12.

 

If anyone has encountered a similar issue or knows of a solution, I would greatly appreciate your insights and guidance.

 

Thank you in advance for your assistance.

Best regards,

Replies 21 (21)
1080
Shopify Partner
278 8 39

@fooc  I just started working on,  can you share the your issue step, may be I can help. 

fooc
Shopify Partner
4 0 5

@1080 Hi, Thank you for your reply.

Unfortunately, there are no specific steps to reproduce the problem.

In our case, out of all purchases, there are about 25% of cases where the "checkout_completed" event is not being triggered.

iwasdenied
Shopify Partner
1 0 0

I agree with @fooc, this problem is very strange. On one store, everything is tracking fine, and on another, 10 checkouts are only going through 3. Tell me, have you had any success with the solution?

clubyolo
Visitor
2 0 0

@fooc @1080 Hi, I have the same problem. Did you find a solution ?

FabianSchulcz
Shopify Partner
3 0 1

Hi @fooc and @1080, we also noticed this problem. We do not see any pattern when it works and when it does not. Of course it ideally always has `order.id` as well. As asked for in e.g. those threads: 1, 2  
Any updates on this, or empty order object?    

We are still searching for a way to a) reliably get order data which is b) complete on client side.
Improvements would be appreciated a lot.

1080
Shopify Partner
278 8 39

@FabianSchulcz  Not yet

xiddixaid
Shopify Partner
36 0 11

It has been since 13th of May merchants facing this issue but shopify do not want to solve this issue and support will give you lame excuses.

1080
Shopify Partner
278 8 39

@xiddixaid 

 same with the me.

I try to reching out the Support team. but still no resolution.


May be this not right team that can help out. any one share which is concern team for that ?

@fooc @FabianSchulcz  @clubyolo  @iwasdenied  

 

FabianSchulcz
Shopify Partner
3 0 1

Hi @1080,

 

we'll also reach out to support. I do not know to which technical team it will be forwarded to. Hope it will match the request topic this time.    

 

@xiddixaid I haven't lost all hope that this promoted feature will eventually reach a stable state 🤞 Communication and support indeed leave a lot to be desired. 

 

Staff?

xiddixaid
Shopify Partner
36 0 11

Its not about the hope its about the money we are losing, spending on ads, facebook ads behaving in worst way because they are not counting conversion.

onlyup
New Member
4 0 0

What if we add the event on the order stats "thank you" page, instead of relying on the buggy 

analytics.subscribe("checkout_completed",..
xiddixaid
Shopify Partner
36 0 11

Shopify now recommend to use custom event instead placing code on thank you page. But, it behaves the same way as on thank you page.

ericute
Shopify Partner
48 3 6

Has din been sorted out?

1080
Shopify Partner
278 8 39

@ericute  not yet.

Josh_Uebergang
Shopify Expert
1003 42 264

2 months later and there seems to be progress on it.

 

According to Shopify's documentation about the event, checkout_completed is suppose to be available "on the order status and checkout pages". My tests show the event runs on upsells, but on the following order status page (often known as the thank you page), the event does not run. Surely that can't be intended.

 

When there is no upsell, the event runs on the order status page.

Run Google Shopping ads? Get the free definitive guide to Google Shopping for Shopify (no optin required): https://www.digitaldarts.com.au/google-shopping
jhelmer25
Shopify Partner
4 0 1

I can confirm that we are having this issue as well.

 

We were able to trace the data for individual users and see the event firing multiple times in a percentage of the cases.

 

As a workaround, our internal systems that are receiving the the `checkout_completed` event, deduplicate based on the order ID.

 

However I do agree that this is a bug in shopify, or at the very least, an undocumented behavior with when these `checkout_completed` events fire. We were not able to reproduce it ourselves no matter how hard we tried.

1080
Shopify Partner
278 8 39

Hi @jhelmer25  I have testing with customer event was working fine. also the app pixel it was trigger correct.

 

can i Know more about the your issue  how I can reproduce my side.? 

Clayton_L
Shopify Partner
3 0 1

checkout_completed isn't firing for me. I'm actually a shop admin trying to subscribe to the event using the "Customer Events" feature in the Shopify admin. I'm not having trouble with any other event not firing my handler. I tried stepping through the minified code that handles Customer Events to see what was happening. I see the event start to be fired, but it bails out before reaching the event subscription, and I can't tell why.

Clayton_L
Shopify Partner
3 0 1

I was testing by submitting real orders in incognito mode and using Chrome's JS debugger. All events were firing their subscriptions except for checkout_completed.

OURPETS
Visitor
1 0 0
hi

Clayton_L
Shopify Partner
3 0 1

Update: checkout_completed was firing for me today