orikis
April 24, 2025, 12:19pm
1
Hello everyone!
It’s my first post in this forum.
I’m glad if you provide some advice!
Problem:
Custom Pixel’s “checkout_completed” event is not triggered after the first checkout.
Environment and the result of testing:
macOS(Sequoia 15.4) + Safari(18.4) → Occur
macOS(Sequoia 15.4) + Chrome(135.0.7049.114) → Does not occur
iOS(18.3.2) + Safari → Occur
iOS(18.3.2) + Chrome → Occur (*)
Step of reproduction:
Create custom pixel coded like below and activate it.
analytics.subscribe('checkout_completed', event => {
console.log('checkout_completed event occured!');
})
Launch Safari.
Add some products to cart.
Proceed checkout and complete it. ← “checkout_completed” event will be triggered in this step.
Again, buy some products to cart.
Proceed checkout and complete it. ← “checkout_completed” event won’t be triggered in this step.
Expected:
Custom Pixel’s “checkout_completed” event is triggered on every checkout completes.
Actual
Custom Pixel’s “checkout_completed” event only triggered on the first checkout complete.
Have anyone experienced this behavior?
If there any missing information, I’ll append it.
Sincerely.
orikis
April 24, 2025, 12:52pm
2
Hi Protech3! Thank you very much for your post. It’s very helpful, because your information covers various aspects.
I want to confirm my recognition about case1 and case2.
I’m implimenting code according to ‘Custom web pixels’ in this article.
https://shopify.dev/docs/api/web-pixels-api/
That’s why I recognize that it is unecessary to implement any “register” and “cleanup” process.
Is this recognition correct?
orikis
April 26, 2025, 8:14am
3
I’m addressing this problem now.
I found that this behavior occur when user completes checkout with having “loggedConversion2” cookie entry.
This behavior does not occur when I delete “loggedConversion2” cookie entry just before completes checkout.
“loggedConversion2” is added to browser’s cookie when user completes the first checkout.
My next step is to find settings of control “loggedConversion2” cookie.
(I don’t recognize about “loggedConversion2” at all. This is not my customization.)
orikis
April 26, 2025, 8:37am
4
I found the Javascript code below on my checkout page.
It may indicates that “checkout_completed” will not be published if “loggedConversion2” exists and the value is 1.
...
We = "loggedConversion2",
...
publish(n, r, o) {
if ("string" != typeof n)
throw new Error("Expected event name to be a string, but got " + typeof n);
if (!Kn(n))
return !1;
if ("checkout_completed" === n && qn() && "1" === Yt(We)) // <- Here
return !1;
I presume that this code guards the unexpected “checkout_completed” on the case where the checkout is already completed before.
However, in my case, it seems that this code prevents “checkout_completed” even on another new checkout session.
Is the cause depends on my settings? Does anyone facing the same problem?
I made workaround for it. By far, it is working.
I connected this custom pixel to my shop.
When user checkout our product, “loggedConversion2” entry is removed from cookie.
By removing “loggedConversion2”, “checkout_completed” is triggered every checkout.
Maybe this workaround needs more test, but I check this thread as “Solved”.
analytics.subscribe('checkout_started', event => {
document.cookie = "loggedConversion2=; max-age=0";
});