Meta / Facebook · Web Pixels API replacement · confidence: high
Dies 2026-08-26
analytics.subscribe('checkout_started', (event) => {
const { checkout } = event.data;
if (!checkout) return;
const value = checkout.totalPrice ? checkout.totalPrice.amount : undefined;
const currency = checkout.totalPrice ? checkout.totalPrice.currencyCode : undefined;
const numItems = checkout.lineItems.reduce((sum, item) => sum + item.quantity, 0);
fetch(`https://graph.facebook.com/v20.0/PIXEL_ID/events?access_token=ACCESS_TOKEN`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
keepalive: true,
body: JSON.stringify({
data: [{
event_name: 'InitiateCheckout',
event_time: Math.floor(Date.now() / 1000),
event_id: checkout.token,
action_source: 'website',
custom_data: { value, currency, num_items: numItems },
}],
}),
});
});What this does NOT cover
What this does NOT cover: repeated or abandoned checkout attempts by the same shopper — Shopify can fire checkout_started more than once per session, and this snippet does not dedupe across attempts. It also does not cover server-side CAPI InitiateCheckout dedup logic, which must be verified against the shared event_id independently.
Meta / Facebook family · Meta Pixel + Meta CAPI + Meta Ads post-purchase — Aug 26 breakage is same across all.