Meta / Facebook · Web Pixels API replacement · confidence: medium
Dies 2026-08-26
// Post-purchase remarketing / custom-audience tagging that used to live in
// the "Additional Scripts" box on the Thank You / Order Status page.
analytics.subscribe('checkout_completed', (event) => {
const { checkout } = event.data;
if (!checkout) return;
// Persist a first-party "purchased" flag so future sessions can be
// excluded from prospecting audiences client-side, mirroring what the old
// Additional Scripts snippet did with a cookie.
browser.cookie.set('pp_purchased', '1');
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: 'Purchase',
event_time: Math.floor(Date.now() / 1000),
event_id: checkout.token,
action_source: 'website',
custom_data: {
value: checkout.totalPrice ? checkout.totalPrice.amount : undefined,
currency: checkout.totalPrice ? checkout.totalPrice.currencyCode : undefined,
content_ids: checkout.lineItems.map((i) => i.variant && i.variant.id).filter(Boolean),
},
}],
}),
});
});What this does NOT cover
What this does NOT cover: post-purchase UPSELL page events (a separate, later checkout_completed-adjacent flow per Shopify docs) — those need their own verification pass. It also does not cover cross-sell/upsell apps that inject their own additional scripts on the same page; each app's script needs its own duplicate-fire audit.
Meta / Facebook family · Meta Pixel + Meta CAPI + Meta Ads post-purchase — Aug 26 breakage is same across all.