From e7c845db7c791bbf386641bbf54d55934001b640 Mon Sep 17 00:00:00 2001 From: Devin Michael Date: Thu, 26 Nov 2026 16:52:55 +0700 Subject: [PATCH 1/3] Campaign Cart SDK 0.5.1: What's new link, 0.5.1 Meta events, Everflow setMetadata, sdk_version example --- content/docs/campaigns/index.mdx | 1 + content/docs/campaigns/meta.json | 1 + content/docs/campaigns/page-kit.mdx | 2 +- content/docs/campaigns/tracking/everflow.mdx | 8 +++++--- content/docs/campaigns/tracking/meta.mdx | 14 +++++++++++++- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/content/docs/campaigns/index.mdx b/content/docs/campaigns/index.mdx index 245018e..9db0be8 100644 --- a/content/docs/campaigns/index.mdx +++ b/content/docs/campaigns/index.mdx @@ -133,6 +133,7 @@ The pages above are wired up by the **Campaign Cart SDK**. Its documentation is | --- | --- | | [Getting started](https://cart-sdk.nextcommerce.com/latest/quickstart/) | Loading the SDK and configuring it | | [Migrating from 0.4.x](https://cart-sdk.nextcommerce.com/latest/migrating-from-0-4/) | What changed for pages built on 0.4.x: removed, deprecated, unchanged | +| [What's new in 0.5.1](https://cart-sdk.nextcommerce.com/latest/whats-new-in-0-5-1/) | What 0.5.1 changes from 0.5.0, and what to check before you upgrade | | [Data attributes](https://cart-sdk.nextcommerce.com/latest/attributes/) | Every `data-next-*` attribute | | [JavaScript API](https://cart-sdk.nextcommerce.com/latest/javascript-api/) | The `window.next` methods | | [Events](https://cart-sdk.nextcommerce.com/latest/events/) | Every `next.on` event and its payload | diff --git a/content/docs/campaigns/meta.json b/content/docs/campaigns/meta.json index 4a739a8..0568905 100644 --- a/content/docs/campaigns/meta.json +++ b/content/docs/campaigns/meta.json @@ -14,6 +14,7 @@ "external:[SDK documentation](https://cart-sdk.nextcommerce.com/latest/)", "external:[Getting started](https://cart-sdk.nextcommerce.com/latest/quickstart/)", "external:[Migrating from 0.4.x](https://cart-sdk.nextcommerce.com/latest/migrating-from-0-4/)", + "external:[What's new in 0.5.1](https://cart-sdk.nextcommerce.com/latest/whats-new-in-0-5-1/)", "external:[Data attributes](https://cart-sdk.nextcommerce.com/latest/attributes/)", "external:[JavaScript API](https://cart-sdk.nextcommerce.com/latest/javascript-api/)", "external:[Events](https://cart-sdk.nextcommerce.com/latest/events/)", diff --git a/content/docs/campaigns/page-kit.mdx b/content/docs/campaigns/page-kit.mdx index 76f6176..30c540b 100644 --- a/content/docs/campaigns/page-kit.mdx +++ b/content/docs/campaigns/page-kit.mdx @@ -366,7 +366,7 @@ Then add an entry keyed by slug: "my-campaign": { "name": "My Campaign", "description": "My first campaign", - "sdk_version": "0.5.0" + "sdk_version": "0.5.1" } } ``` diff --git a/content/docs/campaigns/tracking/everflow.mdx b/content/docs/campaigns/tracking/everflow.mdx index 4ab3dd1..61fa3be 100644 --- a/content/docs/campaigns/tracking/everflow.mdx +++ b/content/docs/campaigns/tracking/everflow.mdx @@ -3,7 +3,7 @@ title: Everflow description: Report NEXT Campaigns sales to Everflow with the Everflow app, for both redirect links and direct links, and avoid duplicate or missing conversions. sidebar_label: Everflow audience: [merchant, developer] -last_verified: 2026-11-16 +last_verified: 2026-11-26 tags: - Guide --- @@ -90,9 +90,11 @@ EF.click({ // Put the ID on the order. var apply = function (next) { - next.setMetadata({ everflow_transaction_id: id }); + var metadata = { everflow_transaction_id: id }; + if (next.actions && typeof next.actions.setMetadata === 'function') next.actions.setMetadata(metadata); // SDK 0.5.1 and later + else if (typeof next.setMetadata === 'function') next.setMetadata(metadata); // SDK 0.4.x }; - if (window.next && typeof window.next.setMetadata === 'function') apply(window.next); + if (window.next && ((window.next.actions && window.next.actions.setMetadata) || typeof window.next.setMetadata === 'function')) apply(window.next); else (window.nextReady = window.nextReady || []).push(apply); }); ``` diff --git a/content/docs/campaigns/tracking/meta.mdx b/content/docs/campaigns/tracking/meta.mdx index 73e86aa..2b46426 100644 --- a/content/docs/campaigns/tracking/meta.mdx +++ b/content/docs/campaigns/tracking/meta.mdx @@ -3,7 +3,7 @@ title: Meta Pixel and Conversions API description: Track your NEXT campaign in Meta. Turn on the Meta pixel on your campaign pages, send purchases from NEXT's servers with the Meta Pixel app, and make sure Meta counts each purchase once. sidebar_label: Meta audience: [merchant, developer] -last_verified: 2026-11-16 +last_verified: 2026-11-26 tags: - Guide --- @@ -100,6 +100,18 @@ See the [Meta Pixel app docs](https://docs.nextcommerce.com/docs/apps/meta-pixel The `Purchase` is sent on the first page after payment: the upsell page, or the receipt if there is no upsell. + +The table above is for SDK 0.4.x, which the starter templates use. On SDK 0.5.1 the pixel gets these events instead: + +- `PageView`, `ViewContent`, `InitiateCheckout` and `AddPaymentInfo`, as above. +- `AddToCart` for the first item added in a session only. +- `Lead` when the shopper's contact details are saved at checkout. +- `Purchase` once per order, on the checkout page when the order is paid there. None is sent when an upsell is accepted. +- No `RemoveFromCart`, `AddShippingInfo`, `ViewedUpsell` or `SkippedUpsell`. + +The SDK sends `PageView` itself on every page, so remove `fbq('track', 'PageView')` from your pixel base code or it is sent twice. + + ## Purchases and upsells The browser and the server report the same purchase with different amounts. From 4128e606d1cd8421090865bfece173e66b5c7a6a Mon Sep 17 00:00:00 2001 From: Devin Michael Date: Thu, 26 Nov 2026 17:35:10 +0700 Subject: [PATCH 2/3] Meta guide: label Purchase timing by SDK version; 0.5.1 test-code snippet --- content/docs/campaigns/tracking/meta.mdx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content/docs/campaigns/tracking/meta.mdx b/content/docs/campaigns/tracking/meta.mdx index 2b46426..abfc56c 100644 --- a/content/docs/campaigns/tracking/meta.mdx +++ b/content/docs/campaigns/tracking/meta.mdx @@ -98,7 +98,7 @@ See the [Meta Pixel app docs](https://docs.nextcommerce.com/docs/apps/meta-pixel | An upsell page is shown | `ViewedUpsell` (custom event) | | An upsell is declined | `SkippedUpsell` (custom event) | -The `Purchase` is sent on the first page after payment: the upsell page, or the receipt if there is no upsell. +On SDK 0.4.x the `Purchase` is sent on the first page after payment: the upsell page, or the receipt if there is no upsell. On 0.5.1 it is usually sent earlier, as the note below says. The table above is for SDK 0.4.x, which the starter templates use. On SDK 0.5.1 the pixel gets these events instead: @@ -118,7 +118,7 @@ The browser and the server report the same purchase with different amounts. | | Meta pixel (browser) | Meta Pixel app (server) | | --- | --- | --- | -| When | The first page after payment | 10 minutes after the order, with the delay on | +| When | On SDK 0.4.x, the first page after payment. On 0.5.1, the checkout page when the order is paid there | 10 minutes after the order, with the delay on | | Amount | The price of the items in the first sale, as shown on your store, without shipping | The full order total, including tax and shipping | | Upsells | Not included | Included, when accepted within the 10 minutes | | ID | `your-store-100041` | `your-store-100041` | @@ -193,7 +193,8 @@ To test the Meta Pixel app as well: ``` From b6ef66a50cea50debc77d7ecb61eb87fd84a6d19 Mon Sep 17 00:00:00 2001 From: Devin Michael Date: Fri, 27 Nov 2026 03:41:27 +0700 Subject: [PATCH 3/3] Page kit: sdk_version example matches the starter templates (0.4.43) --- content/docs/campaigns/page-kit.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/campaigns/page-kit.mdx b/content/docs/campaigns/page-kit.mdx index 30c540b..c323f66 100644 --- a/content/docs/campaigns/page-kit.mdx +++ b/content/docs/campaigns/page-kit.mdx @@ -366,7 +366,7 @@ Then add an entry keyed by slug: "my-campaign": { "name": "My Campaign", "description": "My first campaign", - "sdk_version": "0.5.1" + "sdk_version": "0.4.43" } } ```