Issue with detecting checkout_completed event using Web Pixel app extension

as far as i can tell, no, Shopify has not solved the issue.

i’ve been running multiple tests for the last few days using “Settings” > “Customer events” > “custom pixel”.

i created our own test JS snippet as a way to instantly get feedback from the server, without having to wait on any FB or Google platform delays.

our snippet simply records the timestamp, an event name (whatever we set it to in the “dtag()” function), and a payload (for this test it’s empty {}).

the code is below (with the snippet url removed for privacy reasons):

const script=document.createElement("script");
function dtag(){dtagQueue.push(arguments)}script.setAttribute("src",
"https://oursnippeturl.com/record.js"),script.setAttribute("async",
""),document.head.appendChild(script),window.dtagQueue=window.dtagQueue||[],
function t(){if("function"==typeof window.realDtag)for(
;dtagQueue.length;)window.realDtag.apply(this,dtagQueue.shift());
else setTimeout(t,50)}();

analytics.subscribe("checkout_completed", event => {
  dtag('checkout_completed', {});
});

“checkout_completed” (https://shopify.dev/docs/api/web-pixels-api/standard-events/checkout_completed) fires maybe once out of 10 orders.

when we replace the event with “product_viewed” (https://shopify.dev/docs/api/web-pixels-api/standard-events/product_viewed) the tag seems to fire every time

we’ve also confirmed that this is a Shopify issue. when we run this snippet test on any of our other non-Shopify sites, our JS snippets have no issue capturing whatever actions we send to it

this problem has been extremely frustrating and is costing our client money and making us look bad as well

2 Likes