diff --git a/cod-astro/theme01/src/core/api/types.ts b/cod-astro/theme01/src/core/api/types.ts index 377ac36..a574d9d 100644 --- a/cod-astro/theme01/src/core/api/types.ts +++ b/cod-astro/theme01/src/core/api/types.ts @@ -36,6 +36,7 @@ export interface StoreConfig { otpEnabled: boolean; status: "active" | "inactive"; pixelId?: string | null; + conversionEvent?: "Purchase" | "Purchase_Confirmed" | "Purchase_Delivered" | "Lead" | null; } export interface ShippingRates { diff --git a/cod-astro/theme01/src/pages/thank-you.astro b/cod-astro/theme01/src/pages/thank-you.astro index 577ed63..9b6088a 100644 --- a/cod-astro/theme01/src/pages/thank-you.astro +++ b/cod-astro/theme01/src/pages/thank-you.astro @@ -17,6 +17,15 @@ if (!orderNumber) { } const pixelId = config.pixelId ?? null; +// At checkout stage, only "Purchase" (instant mode) and "Lead" (lead mode) fire on the thank-you page. +// "Purchase_Confirmed" and "Purchase_Delivered" deliberately fire downstream via server CAPI only. +const rawMode = config.conversionEvent ?? "Purchase"; +const checkoutEvent = + rawMode === "Purchase" + ? "Purchase" + : rawMode === "Lead" + ? "Lead" + : null; const totalNum = total ? parseInt(total) : null; const steps = [ @@ -108,16 +117,17 @@ const steps = [ -{pixelId && ( +{pixelId && checkoutEvent && (