A developer encountered an issue where the custom pixel checkout_completed event only fires on the first checkout, but fails on subsequent checkouts in Safari (macOS and iOS). Chrome on macOS works correctly, but iOS Chrome exhibits the same problem.
Root Cause Identified:
The issue stems from a loggedConversion2 cookie that gets set after the first checkout completion. Investigation of the checkout page JavaScript revealed code that prevents checkout_completed from firing when this cookie exists with a value of “1”—apparently designed to prevent duplicate event triggers, but inadvertently blocking legitimate subsequent checkouts.
Workaround Implemented:
The developer resolved this by subscribing to the checkout_started event and deleting the loggedConversion2 cookie before checkout completion:
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?