diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..85b87f8 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# Campaign tracking guides: changes need review from the analytics and attribution owner. +/content/docs/campaigns/tracking/ @masmalsah diff --git a/content/capabilities.yaml b/content/capabilities.yaml index 1cf012e..f71eb4e 100644 --- a/content/capabilities.yaml +++ b/content/capabilities.yaml @@ -277,6 +277,8 @@ capabilities: - /docs/apps/campaigns-app/build-campaign-packages - /docs/apps/campaigns-app/campaigns-offers-and-discounts - /docs/apps/campaigns-app/campaign-analytics + - /docs/apps/meta-pixel + - /docs/features/offers/marketing-attribution developer_docs: - /docs/campaigns - /docs/campaigns/page-kit @@ -284,11 +286,21 @@ capabilities: - /docs/campaigns/templates - /docs/campaigns/api - /docs/campaigns/admin-api + - /docs/campaigns/tracking + - /docs/campaigns/tracking/getting-started + - /docs/campaigns/tracking/google-tag-manager + - /docs/campaigns/tracking/google-analytics-4 + - /docs/campaigns/tracking/meta + - /docs/campaigns/tracking/everflow + - /docs/campaigns/tracking/triple-whale + - /docs/campaigns/tracking/more-integrations + - /docs/campaigns/tracking/shop-sync + - /docs/campaigns/tracking/testing-and-troubleshooting api_operations: [tag:campaigns] webhooks: [] skills: [next-campaigns-create, next-campaigns-setup] status: available - last_verified: 2026-10-22 + last_verified: 2026-11-16 - id: storefront-themes title: Storefront themes diff --git a/content/docs/admin-api/guides/external-checkout.mdx b/content/docs/admin-api/guides/external-checkout.mdx index 6f3cce3..5b139df 100644 --- a/content/docs/admin-api/guides/external-checkout.mdx +++ b/content/docs/admin-api/guides/external-checkout.mdx @@ -208,7 +208,7 @@ Users are first checked for an existing user by `email` before creating a new us **It is not recommended to pass `phone_number` directly on the user when creating a cart or order, we recommend passing a local phone number in the `shipping_address` instead.** Address fields have country context, which allows local phone numbers to be passed and converted to [E.164 format](https://en.wikipedia.org/wiki/E.164) before being saved. A `phone_number` passed to the `user` object directly must be in E.164 format. ## Cart / Order Attribution Detail -Cart and Order `attribution` object sets the [marketing attribution](https://docs.nextcommerce.com/docs/features/offers/marketing-attribution) on the order for tracking the source of orders and use in orders reporting. You can also pass in [metadata](https://docs.nextcommerce.com/docs/build-a-store/technical-settings/metadata-fields-and-tags) fields that are configured on the store to track custom attribution parameters and integrate external tracking platforms. +Cart and Order `attribution` object sets the [marketing attribution](https://docs.nextcommerce.com/docs/features/offers/marketing-attribution) on the order for tracking the source of orders and use in orders reporting. You can also pass in [metadata](https://docs.nextcommerce.com/docs/build-a-store/technical-settings/metadata-fields-and-tags) fields that are configured on the store to track custom attribution parameters and integrate external tracking platforms. For how NEXT Campaigns funnels fill these fields, see [Tracking](/docs/campaigns/tracking#for-developers). ```json title="Attribution Detail" "attribution": { diff --git a/content/docs/apps/guides/marketing-attribution.mdx b/content/docs/apps/guides/marketing-attribution.mdx index acdd7eb..ada55bd 100644 --- a/content/docs/apps/guides/marketing-attribution.mdx +++ b/content/docs/apps/guides/marketing-attribution.mdx @@ -215,6 +215,10 @@ Attribution metadata stored on the cart is automatically carried over to the ord ## Campaigns & API Order Attribution + +This guide is for building an attribution app. To set up ad tracking on a NEXT campaign, see [Tracking](/docs/campaigns/tracking). + + Not all orders originate from the storefront. Orders created through [Campaigns](/docs/campaigns), the [Admin API](/docs/admin-api), and recurring [Subscription](/docs/admin-api/guides/subscription-management) renewals bypass the storefront entirely — [Webhooks](/docs/webhooks) are the way to capture attribution data for these conversions. ### Subscribe to Webhooks diff --git a/content/docs/campaigns/api/index.mdx b/content/docs/campaigns/api/index.mdx index 2c3ba8d..88acd17 100644 --- a/content/docs/campaigns/api/index.mdx +++ b/content/docs/campaigns/api/index.mdx @@ -36,6 +36,8 @@ Session tracking is available to enable visibility into campaign performance by These events flow into Campaign Performance reports for real-time monitoring of activity on your campaign. +Session tracking feeds NEXT's own campaign reports only. To send events to ad and analytics platforms, and for the attribution fields you can pass on carts and orders, see [Tracking](/docs/campaigns/tracking). + ### Packages A **package** is a virtual link to a product or product variant in your campaign — what customers reference by `package_id` when creating carts and orders. Each package is usually one product variant at its campaign price. In Campaigns App, packages are created when an offer selects a store product, and they are listed on the campaign's **Products** tab; over the [Admin API](/docs/campaigns/admin-api#add-packages-to-a-campaign) you create them directly. Send the selected package and quantity from the page. Older campaigns may still expose package-level quantity for compatibility, but new quantity tiers should be modeled with offers rather than separate `1x`, `2x`, and `3x` package records. diff --git a/content/docs/campaigns/index.mdx b/content/docs/campaigns/index.mdx index bbf53ff..abafa5a 100644 --- a/content/docs/campaigns/index.mdx +++ b/content/docs/campaigns/index.mdx @@ -134,7 +134,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 | | [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 | -| [Analytics events](https://cart-sdk.nextcommerce.com/latest/analytics/) | Every tracking event and its payload | +| [Analytics events](https://cart-sdk.nextcommerce.com/v0.4.43/reference/analytics-events) | Every tracking event and its payload | | [URL parameters](https://cart-sdk.nextcommerce.com/latest/attribute-reference/setup/url-parameters/) | Parameters the SDK reads at boot | | [Loader script](https://cart-sdk.nextcommerce.com/latest/attribute-reference/setup/loader-script/) | Attributes the loader script reads (`data-campaign`, `data-funnel`) | | [Debugger](https://cart-sdk.nextcommerce.com/latest/javascript-api/#debugging-with-debug1) | The `?debug=1` debug panel | @@ -234,15 +234,17 @@ For conditional shipping discounts, such as free shipping at 3 or more, use a `s ### Domains -Domains are configured in your store's **Campaign Settings** and apply across all campaigns. They control which domains are authorized to use your campaign API keys. +Domains are configured in the Campaigns app, under **Settings**, then **Allowed Domains**, and apply across all campaigns. They control which domains are authorized to use your campaign API keys. -| Type | SDK Access | Analytics Tracking | +| Type | SDK Access | NEXT campaign analytics | | --- | --- | --- | -| **Production** | Yes | Yes — events tracked automatically | -| **Development** | Yes | No — events suppressed | +| **Production** | Yes | Yes, events recorded automatically | +| **Development** | Yes | No, events ignored | + +The environment setting controls NEXT's own campaign analytics only. Vendor pixels and the SDK's event stream still run on development domains. See [Test and troubleshoot tracking](/docs/campaigns/tracking/testing-and-troubleshooting). -Add `localhost` and any staging domains as **development** domains so you can test the full checkout flow without polluting analytics data. +Add `localhost` and any staging domains as **development** domains so you can test the full checkout flow without adding sessions to NEXT campaign analytics. Vendor pixels on those pages still fire. @@ -253,36 +255,18 @@ Requests from domains not listed in either production or development will be rej ## Analytics & Tracking -Every starter template ships with NEXT Campaign Analytics **on by default** in auto mode. The SDK automatically tracks the full funnel — page views, add-to-cart, begin checkout, shipping/payment info, purchase, and upsells — through the always-on internal `nextCampaign` provider. No code required. - -To also forward those events to **Google Tag Manager** or **Facebook Pixel**, add your IDs in `_data/campaigns.json`: +Every starter template ships with NEXT Campaign Analytics **on by default**. The SDK automatically tracks the full funnel (page views, add-to-cart, begin checkout, shipping and payment info, purchase, and upsells) for NEXT's own campaign reports. No code required. -```json -{ - "my-campaign": { - "name": "My Campaign", - "...": "...", - "gtm_id": "GTM-XXXXXXX", - "fb_pixel_id": "123456789012345" - } -} -``` - - -The matching `providers.gtm.enabled` and `providers.facebook.enabled` flags in `assets/config.js` control whether the SDK **forwards events** to each provider. Templates ship with these set to `false` — flip them to `true` once your IDs are in place. See the per-provider guides below for the full wiring. - +To send those events to your ad and analytics platforms, see [Tracking](/docs/campaigns/tracking). -Two mechanisms skip tracking entirely — including the always-on internal `nextCampaign` provider — so your campaign dashboards reflect **real customer conversions**, not internal QA or test traffic: - -- **Development domains** — any domain marked *development* in your store's Campaign Settings suppresses all events. Add `localhost`, staging URLs, and preview hosts here. -- **`?ignore=true` URL parameter** — append it to any URL to silence tracking for the entire session, useful for one-off testing on a production domain. Clear it with `window.NextAnalyticsClearIgnore()`. - +Two things keep test traffic out of NEXT's campaign reports: +- **Development domains**: NEXT campaign analytics ignores visits from any domain set to *Development* in the Campaigns app, under **Settings**, then **Allowed Domains**. Add `localhost`, staging URLs and preview hosts there. +- **`?ignore=true`**: add it to any link to turn tracking off for that browser tab. -### Event reference - -- [Analytics events](https://cart-sdk.nextcommerce.com/latest/analytics/): every tracking event the SDK emits, what triggers it, and what each destination receives +Do not use `?ignore=true` when you are checking that a purchase is reported. See [Test and troubleshoot tracking](/docs/campaigns/tracking/testing-and-troubleshooting). + --- diff --git a/content/docs/campaigns/meta.json b/content/docs/campaigns/meta.json index 67a941a..8adb683 100644 --- a/content/docs/campaigns/meta.json +++ b/content/docs/campaigns/meta.json @@ -8,6 +8,7 @@ "index", "templates", "page-kit", + "tracking", "[Playground](/playground)", "---Cart SDK---", "external:[SDK documentation](https://cart-sdk.nextcommerce.com/latest/)", diff --git a/content/docs/campaigns/tracking/everflow.mdx b/content/docs/campaigns/tracking/everflow.mdx new file mode 100644 index 0000000..4ab3dd1 --- /dev/null +++ b/content/docs/campaigns/tracking/everflow.mdx @@ -0,0 +1,195 @@ +--- +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 +tags: + - Guide +--- +import { Callout } from 'fumadocs-ui/components/callout'; + +Everflow pays affiliates for sales, so a missing or duplicated conversion costs real money. This guide shows the setup we recommend and the mistakes to avoid. + +## How it works + +Everflow gives every ad click an ID, called the transaction ID. To report a sale, Everflow needs that same ID back. + +1. The shopper clicks an affiliate link, and Everflow creates a transaction ID. +2. Your campaign saves the transaction ID on the order. +3. The NEXT Everflow app sends the sale to Everflow from NEXT's servers, with that ID. + +The rule that keeps this working: **one order, one transaction ID, one thing reporting the sale.** + +## What we recommend + +- **Let the NEXT Everflow app report the sale.** It runs on NEXT's servers and only reports real, placed orders. +- **Use redirect links where you can.** They are the simplest and most reliable way to get the transaction ID onto the order. +- **Use direct links when the ad platform needs them**, with the bridge snippet below. +- **Do not also report the sale from Google Tag Manager.** A purchase tag in GTM alongside the app is the usual cause of duplicate conversions. + +## Before you start + +- Your Everflow network ID and postback URL, from your Everflow account or your affiliate network. +- A campaign that is ready for tracking. See [Set up tracking](/docs/campaigns/tracking/getting-started). + +## Set up the Everflow app + +1. In your store dashboard, open **Apps**, then **Everflow**. +2. Enter your **Everflow Postback URL** and **Everflow Network ID**. Only the domain of the postback URL is used; anything after it is ignored. +3. Keep **Enable Everflow S2S Postback** on. + +| Setting | What it does | +| --- | --- | +| **Everflow Postback Delay Minutes** | 0 by default, so the conversion is sent straight away and does not include upsells. Set it to up to 10 minutes so upsells accepted in that time are included in the amount | +| **Everflow Verification Token** | Optional. Sent with each conversion if your network requires one | +| **Include Tax in Conversion Value** | Off by default. The amount is the order total without tax unless you turn this on | +| **Enable S2S Postback for test orders** | Off by default. Test orders are skipped unless this is on | + +See the [Everflow app docs](https://docs.nextcommerce.com/docs/apps/everflow) for more. + +## Get the transaction ID onto the order + +Which setup you need depends on how your affiliate links work. + +| | Redirect links | Direct links | +| --- | --- | --- | +| How the shopper arrives | Through Everflow first, then to your campaign | Straight to your campaign | +| Where the transaction ID comes from | It is on the link, as `evclid` | Everflow's click script creates it in the browser | +| What you add to the campaign | Nothing | The bridge snippet | +| Use it when | The ad platform allows a redirecting link | The ad platform does not. Google Ads requires the final URL to stay on one domain | + +### Redirect links + +Set up your Everflow offer so the link to your campaign carries Everflow's transaction ID in a parameter named `evclid`: + +```text +https://campaign.example.com/?evclid=EVERFLOW_TRANSACTION_ID +``` + +Use Everflow's transaction ID macro for the value. See Everflow's [guide to parameters and macros](https://helpdesk.everflow.io/en/articles/6173403-a-guide-to-parameters-and-macros). + +The campaign saves it on the order by itself. Nothing else is needed. + +### Direct links + +With a direct link there is no `evclid`. Everflow's click script, which your affiliate partner usually runs in their own Google Tag Manager container, creates the transaction ID when the page loads. That ID then has to be handed to the campaign, or the order has no ID and nothing is reported. + +Keep the partner's own `EF.click` call as it is, and add this to what happens after it. It saves the ID and puts it on the order: + +```js +EF.click({ + // ...the partner's usual click settings (offer, affiliate, subs) +}).then(function (transactionId) { + // Do nothing when Everflow returns no ID, so a good ID is never replaced by an empty one. + if (!transactionId) return; + var id = String(transactionId); + + // Keep the ID for later pages. + try { localStorage.setItem('evclid', id); } catch (e) {} + + // Put the ID on the order. + var apply = function (next) { + next.setMetadata({ everflow_transaction_id: id }); + }; + if (window.next && typeof window.next.setMetadata === 'function') apply(window.next); + else (window.nextReady = window.nextReady || []).push(apply); +}); +``` + + +Each time the click script runs, Everflow can create a new transaction ID. If that happens on the checkout or upsell page, the order and the conversion can end up with different IDs. Use one of these: + +- Run the click once per visit, on the page the shopper lands on. +- Or run it on every page, but pass the saved ID back in as `transaction_id`, so Everflow reuses it. If you run more than one offer on a domain, only pass an ID back for the offer it was created for. + +Either way, do not attach the click script to a purchase or upsell tag. + + +Direct links are less reliable than redirect links. If the click script does not return an ID, for example because it was blocked, that order has no ID and is not reported. + +## Affiliate details on the link + +The campaign also saves the affiliate (`aff` or `affid`) and sub-affiliate values (`sub1` to `sub5`) from the link onto the order. See the SDK's [attribution parameters](https://cart-sdk.nextcommerce.com/v0.4.43/reference/url-parameters#attribution). + +## What the app sends + +For each order with a transaction ID, the app sends a conversion to Everflow with: + +- Your network ID +- The transaction ID +- The order number, as Everflow's Order ID +- The amount and currency + +The app sends only these fields, plus the verification token if you set one. If your affiliate network's postback needs extra parameters, such as `aid` or `adv1`, set the Everflow offer up to work with the standard fields. + +An order is not sent when it has no transaction ID, or when it is canceled. + +If an order is reopened later, for example after being archived, the app sends its conversion again with the same transaction ID. Keep **Allow Duplicate Conversions** off on the Everflow offer so Everflow rejects the repeat. + +## More rules to avoid duplicate and missing conversions + +- **Never pay affiliates from a GTM purchase tag alone.** A browser tag can fire without a completed order behind it. The app cannot. +- **Funnel-step events are fine in GTM.** A partner can send page views, checkout started and similar events from their own container. Those are not sales. +- **Changing setups? Add before you remove.** When moving a partner from a GTM conversion tag to the app, add the bridge, check one test order end to end, and only then remove the old tag. + +## If a partner also reports from GTM + +Some partners want their own Everflow conversion tag in GTM as well as the app. That only works when the tag sends the same transaction ID that is on the order. + +- **Pass the ID yourself.** Read it from where the click script saved it: + +```js +EF.conversion({ + // ...the partner's other fields + transaction_id: localStorage.getItem('evclid') +}); +``` + +- **Do not let Everflow pick the ID.** A conversion sent without `transaction_id`, or one that uses `EF.getTransactionId()` or `EF.getAdvertiserTransactionId()`, can send a different click's ID, or several IDs joined together. The sale is then credited to the wrong click, or counted twice. +- **Turn off Allow Duplicate Conversions** on the Everflow offer. Everflow then rejects the second copy of a sale it already has. +- **Put quotes around GTM variables** inside the tag, for example `'{{DLV - Order ID}}'`. Without quotes, a value that is not a number breaks the whole tag and the conversion never fires. + +## More than one affiliate network + +**Several affiliates in one Everflow network** need nothing extra. Each click gets its own transaction ID, and the app reports every sale to that network. + +**A second Everflow network on the same store** needs its own setup. The app holds one network ID, and it sends whatever is in the order's Everflow transaction ID to that network. So the second network must stay out of that slot: + +1. **Put the second network's click ID in a `sub` parameter** on its links, for example `sub2`. Do not use `evclid`. +2. **Let the second network report its own sales** from a conversion tag in its own GTM container, sending that click ID. +3. **Keep its click script separate.** It must not save its ID as `evclid`, and must not set `everflow_transaction_id` on the order. +4. **Run each network's scripts only on its own traffic.** If both containers can load on the same pages, make each network's tags fire only for visits that came from that network. + +| | First network | Second network | +| --- | --- | --- | +| Click ID arrives as | `evclid`, or the bridge | A `sub` parameter, for example `sub2` | +| Sale reported by | The NEXT Everflow app | The network's own GTM conversion tag | +| Saved on the order as | Everflow transaction ID | Subaffiliate 2 | + +If the second network's ID ends up in `evclid`, its sales are sent to the first network and credited there. + +## Verify it works + +1. Turn on **Enable S2S Postback for test orders** in the app. +2. Open your campaign through an Everflow test link, in a new private window. +3. Place an order with a [test card](/docs/testing). +4. Open the order in your store dashboard. Its attribution should show an Everflow transaction ID. +5. In Everflow, search for that transaction ID. You should see one conversion with your order number as the Order ID. +6. **Reject the test conversion in Everflow.** If you do not, it counts as a real conversion and the affiliate is paid for it. +7. Turn **Enable S2S Postback for test orders** off again. + +## Comparing your numbers with your partner's + +- **Match on the order number.** Everflow's Order ID is the NEXT order number. The transaction ID is the click's ID and never matches an order number. +- **Use the same timezone.** NEXT reports in your store's timezone and Everflow defaults to UTC. Line them up before comparing counts. + +## Troubleshooting + +| Problem | Likely cause | Fix | +| --- | --- | --- | +| No conversions in Everflow | The orders have no transaction ID | Redirect links: check `evclid` is on the link. Direct links: check the bridge is in the click script | +| Some direct-link orders are missing | The click script did not return an ID for those visits | Use redirect links where the ad platform allows | +| Conversions counted twice | A GTM conversion tag and the app both report the sale with different IDs | Remove the GTM tag, or make it send the order's transaction ID. See [If a partner also reports from GTM](#if-a-partner-also-reports-from-gtm) | +| A sale is credited to the wrong affiliate or offer | The conversion used an ID from an earlier click | Pass `transaction_id` from the saved ID, and run the click once per visit | +| The amount is lower than expected | Tax is left out, or the upsell was accepted after the conversion was sent | Turn on **Include Tax in Conversion Value**, or set a postback delay | diff --git a/content/docs/campaigns/tracking/getting-started.mdx b/content/docs/campaigns/tracking/getting-started.mdx new file mode 100644 index 0000000..944aa5c --- /dev/null +++ b/content/docs/campaigns/tracking/getting-started.mdx @@ -0,0 +1,98 @@ +--- +title: Set up tracking +description: Turn on tracking for your NEXT campaign. Add your platform IDs to a starter template, publish, and run a first test order. +sidebar_label: Getting started +audience: [merchant, developer] +last_verified: 2026-11-16 +tags: + - Guide +--- +import { Callout } from 'fumadocs-ui/components/callout'; + +This page turns tracking on for a campaign and walks you through a first test. Do it once per campaign. For how tracking works, see the [Tracking overview](/docs/campaigns/tracking). + +## Before you start + +You need: + +- A campaign built from a [starter template](/docs/campaigns/templates). The `landing` template family has no tracking, so use one of the others. +- Your campaign's domain added in the Campaigns app. Open **Settings**, then **Allowed Domains**, click **Add Domain**, and set **Environment** to **Production**. +- The ID for each platform you advertise on, such as your Meta pixel ID or GA4 measurement ID. Each platform guide says where to find it. + +Built your campaign by hand instead of from a starter template? See [Hand-built campaigns](#hand-built-campaigns). + +## Step 1: Add your platform IDs + +Open `_data/campaigns.json`, find your campaign, and add a line for each platform you use. + +```json title="_data/campaigns.json" +{ + "my-campaign": { + "name": "My Campaign", + "fb_pixel_id": "123456789012345", + "ga4_id": "G-XXXXXXXXXX", + "tiktok_pixel_id": "CXXXXXXXXXXXXXXXXXXX" + } +} +``` + +| Platform | Line to add | Guide | +| --- | --- | --- | +| Google Tag Manager | `gtm_id` | [Google Tag Manager](/docs/campaigns/tracking/google-tag-manager) | +| Google Analytics 4 | `ga4_id` | [Google Analytics 4](/docs/campaigns/tracking/google-analytics-4) | +| Google Ads and YouTube | No line of its own. Uses GA4 | [Use GA4 purchases in Google Ads](/docs/campaigns/tracking/google-analytics-4#use-ga4-purchases-in-google-ads) | +| Meta | `fb_pixel_id` | [Meta](/docs/campaigns/tracking/meta) | +| Triple Whale (Shop Sync stores) | `triplewhale_name` | [Triple Whale](/docs/campaigns/tracking/triple-whale) | +| TikTok, Snapchat, Pinterest, Taboola, AppLovin Axon, Northbeam | One line each | [More integrations](/docs/campaigns/tracking/more-integrations) | +| RudderStack | Two lines | [More integrations](/docs/campaigns/tracking/more-integrations#rudderstack) | + +Leave a line out, or leave it empty, to keep that platform off. Anything else turns it on, so do not leave placeholder values in. + +## Step 2: Finish the setup in each platform guide + +Open the guide for each platform you added and follow its **Set up** section. Some platforms need one more setting: + +- **Meta, Google Tag Manager and RudderStack** also need to be switched on in `assets/config.js`. +- **Meta** also needs your store name in `assets/config.js`, and the Meta Pixel app if you want purchases sent from NEXT's servers. + +Leave the rest of the `analytics` settings in `assets/config.js` as they ship. + +## Step 3: Publish + +Build with `npm run build` and deploy to the domain you added as **Production**. + + +`npm run dev` leaves tracking out, so you will not see any events there. Test on a deployed production build. + + +## Step 4: Run a test order + +1. Open a new private browser window. +2. Open your campaign with test details on the link: + +```text +https://campaign.example.com/?utm_source=test&utm_medium=cpc&utm_campaign=launch-test +``` + +3. Go through checkout and pay with a [test card](/docs/testing). +4. Continue to the next page after payment. This is where the purchase is reported. +5. Check each platform received it. Every platform guide has a **Verify it works** section, for example [Meta](/docs/campaigns/tracking/meta#verify-it-works). +6. Open the order in your store dashboard and check that its attribution shows `utm_source` as `test` and `utm_campaign` as `launch-test`. + +Things to know when testing: + +- A test order still reports a purchase to your ad platforms. Platforms cannot tell it is a test. +- Each order is reported once. Reloading the page after payment, or coming back to it, does not report it again. +- Do not add `?ignore=true` to the link. It turns tracking off for that browser tab. + +Something not showing up? See [Test and troubleshoot tracking](/docs/campaigns/tracking/testing-and-troubleshooting). + +## Before you launch + +Make sure each platform hears about a sale once. If more than one thing reports purchases to the same platform, the sale is counted twice. See [Send each purchase from one place](/docs/campaigns/tracking#send-each-purchase-from-one-place). + +If your orders sync to Shopify through Shop Sync, read [Tracking on Shop Sync stores](/docs/campaigns/tracking/shop-sync) before you launch. + +## Hand-built campaigns + +The steps above are for starter templates, which include the tracking code for every supported platform. A campaign you built by hand does not include it. For a hand-built campaign, load your own Google Tag Manager container on every page and send events to your platforms from there. See [Google Tag Manager](/docs/campaigns/tracking/google-tag-manager). diff --git a/content/docs/campaigns/tracking/google-analytics-4.mdx b/content/docs/campaigns/tracking/google-analytics-4.mdx new file mode 100644 index 0000000..a0044fc --- /dev/null +++ b/content/docs/campaigns/tracking/google-analytics-4.mdx @@ -0,0 +1,101 @@ +--- +title: Google Analytics 4 +description: Track your NEXT campaign in Google Analytics 4, and use those purchases as conversions in Google Ads, including for YouTube ads. +sidebar_label: Google Analytics 4 +audience: [merchant, developer] +last_verified: 2026-11-16 +tags: + - Guide +--- + +The starter templates include Google Analytics 4. Add your measurement ID and the campaign reports page views, checkout steps and purchases to your GA4 property. + +GA4 events are sent from the shopper's browser only. The **Google Analytics 4** app you set up under **Apps** in your NEXT dashboard only adds its script to your Storefront. It is not added to your Campaigns, so follow this page to add GA4 to your campaign. + +## Before you start + +- Your GA4 measurement ID. It starts with `G-`. +- A campaign that is ready for tracking. See [Set up tracking](/docs/campaigns/tracking/getting-started). + +## Set up + +1. In `_data/campaigns.json`, add your measurement ID to your campaign: + +```json title="_data/campaigns.json" +{ + "my-campaign": { + "name": "My Campaign", + "ga4_id": "G-XXXXXXXXXX" + } +} +``` + +2. Build with `npm run build` and deploy. + +Do not also add a GA4 tag for the same property in Google Tag Manager. Two copies send every event twice. + +## What gets tracked + +| When | GA4 event | +| --- | --- | +| Any page loads | `page_view` | +| A page shows a product | `view_item` | +| An item is added to the cart | `add_to_cart` | +| The checkout loads | `begin_checkout` | +| A shipping address is entered | `add_shipping_info` | +| Payment details are entered | `add_payment_info` | +| The order is paid | `purchase` | +| An upsell is accepted | `upsell_purchase` | + +The `purchase` is sent on the first page after payment: the upsell page, or the receipt if there is no upsell. + +To stop an event, add `ga4_blocked_events` to your campaign, for example `"ga4_blocked_events": "dl_add_shipping_info"`. + +## Purchases and upsells + +| | Order | Upsell | +| --- | --- | --- | +| GA4 event | `purchase` | `upsell_purchase` | +| Transaction ID | The order number, for example `100041` | The order reference followed by `-US1`, `-US2` and so on | +| Amount | The price of the items as shown on your store, without shipping | The upsell only | + +Upsells are sent as their own event, so your purchase count and average order value describe the first sale. To see upsell revenue in GA4, mark `upsell_purchase` as a key event and include it in your reports. + +The purchase amount is lower than the order total because it is the item prices only. Shipping is sent as a separate field on the event, and so is tax. + +## Use GA4 purchases in Google Ads + +Google Ads, including YouTube ads, has no ID of its own to add to your campaign. Instead, Google Ads imports the purchases your campaign reports to GA4. + +1. In Google Ads, turn on **auto-tagging**. It adds the Google click ID (`gclid`) to your ad links. +2. In GA4, mark `purchase` as a key event. Mark `upsell_purchase` too if you want upsell revenue counted in Google Ads. +3. Link your GA4 property to your Google Ads account. +4. In GA4, open **Advertising**, then **Tools**, then **Conversion management**, and select **New conversion**. Pick your Google Ads account and the key events, then save. Google's steps are in [Create Google Ads conversions from GA4 key events](https://support.google.com/google-ads/answer/10632359?hl=en). +5. In Google Ads, set the new conversion as a primary conversion action if you want it used for bidding. + +Things to know: + +- If you only import `purchase`, Google Ads misses upsell revenue. +- The conversion value is lower than the order total, because it is the item prices only. +- A test order counts as a conversion. +- The `gclid` is saved on the NEXT order, but NEXT does not send orders to Google Ads from its servers, and enhanced conversions are not available. + +If you manage your tags in Google Tag Manager, you can fire a Google Ads conversion tag from there instead. See [Google Tag Manager](/docs/campaigns/tracking/google-tag-manager#google-ads-conversions). Use one way, not both. + +## Keeping the source of the visit + +GA4 reads where a visitor came from off the page link, so keep your UTM parameters on your ad links. Keep every campaign page on one domain, or on subdomains of one domain, so GA4 follows the visitor from page to page. + +## Verify it works + +1. Connect Google Tag Assistant to your campaign at [tagassistant.google.com](https://tagassistant.google.com). This puts that browser's GA4 hits into debug mode, so they appear in DebugView. +2. In GA4, open **Admin**, then **DebugView**. +3. Go through checkout in the window Tag Assistant opens, so the events stay in debug mode. You should see `page_view`, `begin_checkout` and the other events. +4. Place an order with a [test card](/docs/testing). On the next page you should see `purchase` with your order number as the transaction ID. +5. Accept an upsell. You should see `upsell_purchase` on the page after it. + +## Troubleshooting + +If nothing reaches GA4, check that `ga4_id` is set, then rebuild. More help is in [Test and troubleshoot tracking](/docs/campaigns/tracking/testing-and-troubleshooting). + +On a campaign that is not built from a starter template, send events to GA4 from your own [Google Tag Manager](/docs/campaigns/tracking/google-tag-manager) container. diff --git a/content/docs/campaigns/tracking/google-tag-manager.mdx b/content/docs/campaigns/tracking/google-tag-manager.mdx new file mode 100644 index 0000000..559e9b1 --- /dev/null +++ b/content/docs/campaigns/tracking/google-tag-manager.mdx @@ -0,0 +1,130 @@ +--- +title: Google Tag Manager +description: Send your campaign's events to your own Google Tag Manager container, and build tags on them. +sidebar_label: Google Tag Manager +audience: [merchant, developer] +last_verified: 2026-11-16 +tags: + - Guide +--- +import { Callout } from 'fumadocs-ui/components/callout'; + +Google Tag Manager (GTM) does not report anything by itself. It is a container for your own tags. Your campaign sends its events to GTM, and the tags you build decide which platforms hear about them. + +Use GTM when you want to manage tags yourself, or for a platform that has no guide in this section. + +## Before you start + +- A GTM web container and its ID, which looks like `GTM-XXXXXXX`. +- A campaign that is ready for tracking. See [Set up tracking](/docs/campaigns/tracking/getting-started). + +The **Google Tag Manager** app you set up under **Apps** in your NEXT dashboard only adds its script to your Storefront. It is not added to your Campaigns, so follow this page to add GTM to your campaign. + +## Set up + +Setup has two parts, and you need both. + +1. In `_data/campaigns.json`, add your container ID to your campaign. This loads your container on every page: + +```json title="_data/campaigns.json" +{ + "my-campaign": { + "name": "My Campaign", + "gtm_id": "GTM-XXXXXXX" + } +} +``` + +2. In `assets/config.js`, switch `gtm` on. This makes the campaign send its events to the container: + +```js title="assets/config.js" +// Inside analytics.providers: +gtm: { + enabled: true +}, +``` + +3. Build with `npm run build` and deploy. + + +With only `gtm_id`, the container loads but receives no campaign events. With only the `config.js` setting, the events are sent but there is no container to receive them. + + +## Events you can build tags on + +Each event reaches GTM as a data layer event. Create a **Custom Event** trigger with the event name, then attach your tag. + +| Event name | When it happens | +| --- | --- | +| `dl_user_data` | Any page loads. Use this for page view tags | +| `dl_view_item` | A page shows a product | +| `dl_add_to_cart` | An item is added to the cart | +| `dl_begin_checkout` | The checkout loads | +| `dl_add_shipping_info` | A shipping address is entered | +| `dl_add_payment_info` | Payment details are entered | +| `dl_purchase` | The order is paid. Sent on the first page after payment | +| `dl_viewed_upsell` | An upsell page is shown | +| `dl_upsell_purchase` | An upsell is accepted. Sent on the page after it | + +The full list, with every field, is in the SDK's [Analytics events reference](https://cart-sdk.nextcommerce.com/v0.4.43/reference/analytics-events). + +## Reading values in your tags + +Create **Data Layer Variables** in GTM for the values you need. + +| What you want | Data layer variable | +| --- | --- | +| Order number | `ecommerce.transaction_id` | +| Amount | `ecommerce.value` | +| Currency | `ecommerce.currency` | +| Items | `ecommerce.items` | +| Shipping and tax | `ecommerce.shipping`, `ecommerce.tax` | +| UTM parameters | `attribution.utm_source`, `attribution.utm_medium`, `attribution.utm_campaign` | +| Google click ID | `attribution.gclid` | +| Meta click ID | `attribution.metadata.fbclid` | + +The events also carry the shopper's email, phone, name and address under `user_properties`. Decide which tags may read them, and see [Privacy and consent](/docs/campaigns/tracking#privacy-and-consent). + +## Purchases and upsells + +| | `dl_purchase` | `dl_upsell_purchase` | +| --- | --- | --- | +| When | The first page after payment | The page after an upsell is accepted | +| Order ID | The order number, for example `100041` | The order reference followed by `-US1`, `-US2` and so on | +| Amount | The price of the items as shown on your store, without shipping | The upsell only | + +- A purchase is sent once per order. Reloading the page does not send it again. +- A tag on `dl_purchase` alone misses upsell revenue. Add a tag on `dl_upsell_purchase` if you want it. +- The amount is the item prices only. Add `ecommerce.shipping` if your platform should see shipping. On a store that shows prices without tax, add `ecommerce.tax` as well. + + +If a platform is already turned on in your campaign, for example GA4 or TikTok, do not also send it purchases from GTM. See [Send each purchase from one place](/docs/campaigns/tracking#send-each-purchase-from-one-place). + + +### Google Ads conversions + +To count purchases in Google Ads from GTM, add a Google Ads conversion tag on a `dl_purchase` trigger. Set its order ID to `ecommerce.transaction_id`, its value to `ecommerce.value` and its currency to `ecommerce.currency`. Add a second tag on `dl_upsell_purchase` to count upsells. + +Do this only if you are not already importing purchases into Google Ads from GA4. See [Use GA4 purchases in Google Ads](/docs/campaigns/tracking/google-analytics-4#use-ga4-purchases-in-google-ads). + +## Verify it works + +1. Start **Preview** mode in your GTM container and open your campaign. +2. You should see `dl_user_data` first, then the other events as you move through the funnel. +3. Place an order with a [test card](/docs/testing). On the next page, `dl_purchase` appears with the order number. +4. Accept an upsell. `dl_upsell_purchase` appears on the page after it. + +## Troubleshooting + +| Problem | Likely cause | Fix | +| --- | --- | --- | +| The container does not load | `gtm_id` is missing or empty | Add your container ID and rebuild | +| The container loads but receives no events | `gtm` is switched off in `assets/config.js` | Switch it on | +| Tags do not fire | The trigger's event name does not match | Copy the name from GTM Preview | +| A page view trigger never fires | It listens for `dl_page_view` | Use `dl_user_data` | + +More help is in [Test and troubleshoot tracking](/docs/campaigns/tracking/testing-and-troubleshooting). + +## Hand-built campaigns + +On a campaign that is not built from a starter template, add your GTM container to every page yourself, then switch `gtm` on as in step 2. See the [Campaign Cart SDK analytics docs](https://cart-sdk.nextcommerce.com/v0.4.43/reference/analytics-events). diff --git a/content/docs/campaigns/tracking/index.mdx b/content/docs/campaigns/tracking/index.mdx new file mode 100644 index 0000000..7dce258 --- /dev/null +++ b/content/docs/campaigns/tracking/index.mdx @@ -0,0 +1,77 @@ +--- +title: Tracking overview +description: How ad and analytics tracking works in NEXT Campaigns, which platforms are supported, and which guide to follow for Google, Meta, Everflow, Triple Whale, TikTok and more. +sidebar_label: Overview +audience: [merchant, developer] +last_verified: 2026-11-16 +tags: + - Guide +--- +import { Callout } from 'fumadocs-ui/components/callout'; + +Tracking tells your ad platforms which clicks turned into sales. A campaign in NEXT Campaigns is made of your own pages, so tracking is something you turn on for each platform you advertise on. This section shows you how. + +Start with [Set up tracking](/docs/campaigns/tracking/getting-started), then open the guide for your platform. + +## How tracking works + +1. **A shopper clicks your ad.** The link carries details about the ad, such as UTM parameters and a click ID. +2. **Your campaign remembers where they came from.** It keeps those details as the shopper moves from page to page, and saves them on the order. +3. **Your campaign tells each platform what happened.** Page views, checkout steps and purchases are sent to the platforms you have turned on. + +You turn a platform on by adding its ID to your campaign. For a few platforms a NEXT store app also sends the purchase from NEXT's servers. Each guide tells you exactly what to add and where. + + +Tracking apps under **Apps** in your NEXT dashboard, such as TikTok Pixel Events, Google Analytics 4, Google Tag Manager, AppLovin AXON and Taboola Pixel Events, add their scripts to your Storefront. For Campaigns, you add each platform's tracking to the campaign itself. The guides below show you what to add. + +Some apps already cover campaign orders, because they send the order from NEXT's servers once it is placed: the Meta Pixel app's Conversions API purchase, Everflow and Klaviyo. + + +## Supported integrations + +| Platform | Guide | +| --- | --- | +| Google Tag Manager | [Google Tag Manager](/docs/campaigns/tracking/google-tag-manager) | +| Google Analytics 4 | [Google Analytics 4](/docs/campaigns/tracking/google-analytics-4) | +| Google Ads and YouTube | [Use GA4 purchases in Google Ads](/docs/campaigns/tracking/google-analytics-4#use-ga4-purchases-in-google-ads) | +| Meta (Facebook and Instagram) | [Meta Pixel and Conversions API](/docs/campaigns/tracking/meta) | +| Everflow | [Everflow](/docs/campaigns/tracking/everflow) | +| Triple Whale (stores that sync orders to Shopify) | [Triple Whale](/docs/campaigns/tracking/triple-whale) | +| TikTok, Snapchat, Pinterest, Taboola, AppLovin Axon, Northbeam, RudderStack, Klaviyo | [More integrations](/docs/campaigns/tracking/more-integrations) | + +If your orders sync to Shopify through Shop Sync, also read [Tracking on Shop Sync stores](/docs/campaigns/tracking/shop-sync). + +## Send each purchase from one place + +Each platform should hear about a sale once. If two things report the same sale to the same platform, it is counted twice. + +A sale can be reported by your campaign pages, by a NEXT store app, and, on Shop Sync stores, by a Shopify app that sees the synced order. For each platform, pick one of them to report the purchase and turn the others off. The platform guides show how. + +Meta is the one exception: the campaign and the Meta Pixel app can both report the purchase, because they label it with the same ID and Meta merges the two. See the [Meta](/docs/campaigns/tracking/meta#count-each-purchase-once) guide. + +## Privacy and consent + +NEXT Campaigns does not include a cookie banner or consent tool. If your campaign needs one, add it to your pages and make sure it also stops the tracking scripts. + +Some platforms can receive the shopper's email and phone to improve matching. Those settings are off unless you turn them on. Turn them on only when your privacy policy covers it. + +## Next steps + +- [Set up tracking](/docs/campaigns/tracking/getting-started): turn platforms on and run your first test. +- [Test and troubleshoot tracking](/docs/campaigns/tracking/testing-and-troubleshooting): check what was sent and fix common problems. + +## For developers + +The campaign's own events, their fields, and the ad details saved on each order are documented in the Campaign Cart SDK reference. The starter templates use SDK 0.4.43, so use the 0.4.43 pages: + +| What you need | SDK reference | +| --- | --- | +| Every event and when it is sent | [Analytics events: event names](https://cart-sdk.nextcommerce.com/v0.4.43/reference/analytics-events#event-names) | +| The fields on each event | [Analytics events: payload reference](https://cart-sdk.nextcommerce.com/v0.4.43/reference/analytics-events#payload-reference) | +| What GTM, Meta and RudderStack each receive | [Analytics events: providers](https://cart-sdk.nextcommerce.com/v0.4.43/reference/analytics-events#providers) | +| Which link parameters are saved on the order | [URL parameters: attribution](https://cart-sdk.nextcommerce.com/v0.4.43/reference/url-parameters#attribution) | +| Adding your own values to the order, with examples | [JavaScript API: attribution and metadata](https://cart-sdk.nextcommerce.com/v0.4.43/reference/javascript-api#attribution-and-metadata) | +| Sending your own events, with examples | [JavaScript API: analytics](https://cart-sdk.nextcommerce.com/v0.4.43/reference/javascript-api#analytics) | +| Checking events in the browser | [Debugger](https://cart-sdk.nextcommerce.com/v0.4.43/reference/debugger) | + +To read the saved ad details from an order, see [Marketing attribution](/docs/apps/guides/marketing-attribution). diff --git a/content/docs/campaigns/tracking/meta.json b/content/docs/campaigns/tracking/meta.json new file mode 100644 index 0000000..065fbf6 --- /dev/null +++ b/content/docs/campaigns/tracking/meta.json @@ -0,0 +1,15 @@ +{ + "title": "Tracking", + "pages": [ + "index", + "getting-started", + "google-tag-manager", + "google-analytics-4", + "meta", + "everflow", + "triple-whale", + "more-integrations", + "shop-sync", + "testing-and-troubleshooting" + ] +} diff --git a/content/docs/campaigns/tracking/meta.mdx b/content/docs/campaigns/tracking/meta.mdx new file mode 100644 index 0000000..73e86aa --- /dev/null +++ b/content/docs/campaigns/tracking/meta.mdx @@ -0,0 +1,215 @@ +--- +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 +tags: + - Guide +--- +import { Callout } from 'fumadocs-ui/components/callout'; + +Meta tracking on a campaign has two parts: + +- **The Meta pixel** reports page views, checkout steps and purchases from the shopper's browser. You set it up in your campaign files. +- **The Meta Pixel app** reports each purchase again from NEXT's servers. You set it up in your store dashboard. + +You can use the pixel on its own, but both together give Meta the most complete picture. When both report a purchase, they label it with the same ID, so Meta counts it once. + +## Before you start + +- Your Meta pixel ID. For the Meta Pixel app you also need an access token for that pixel. +- Your store name: the part before `.29next.store` in your store address. For `your-store.29next.store` it is `your-store`. +- A campaign that is ready for tracking. See [Set up tracking](/docs/campaigns/tracking/getting-started). + +## Set up + +### Part 1: Meta pixel + +1. In `_data/campaigns.json`, add your pixel ID to your campaign: + +```json title="_data/campaigns.json" +{ + "my-campaign": { + "name": "My Campaign", + "fb_pixel_id": "123456789012345" + } +} +``` + +2. In `assets/config.js`, set `storeName` to your store name, switch `facebook` on, and enter the same pixel ID: + +```js title="assets/config.js" +window.nextConfig = { + // ...your existing settings + storeName: 'your-store', + analytics: { + enabled: true, + mode: 'auto', + providers: { + // ...other providers unchanged + facebook: { + enabled: true, + settings: { + pixelId: '123456789012345' + } + } + } + } +}; +``` + +3. Build with `npm run build` and deploy. + + +With only `fb_pixel_id`, the pixel loads but sends nothing. With only the `config.js` setting, there is no pixel to send through. Templates ship with `storeName: 'store-name'` and `facebook` switched off, so change both. + + +Do not add your own `fbq('track', 'PageView')` to the pages. The campaign already sends page views, and a second call counts each one twice. + +### Part 2: Meta Pixel app + +1. In your store dashboard, open **Apps**, then **Meta Pixel**. +2. Select **Add Pixel**, enter the **Pixel ID** and **Access Token**, and save. Use the same pixel as in Part 1. +3. Set it as the **Default Meta Pixel**. + +The app's other settings: + +| Setting | Default | What it does | +| --- | --- | --- | +| **Enable Delay Order Confirmation** | On | Waits 10 minutes before sending the purchase, so upsells accepted in that time are included | +| **Enable Sending Test Data** | Off | Test orders are skipped unless this is on | +| **Ignore Subscription Renewal Orders** | On | Subscription renewals are not sent as purchases | + +See the [Meta Pixel app docs](https://docs.nextcommerce.com/docs/apps/meta-pixel) for more. + +## What gets tracked + +| When | Meta event | +| --- | --- | +| Any page loads | `PageView` | +| A page shows a product | `ViewContent` | +| An item is added to the cart | `AddToCart` | +| An item is removed from the cart | `RemoveFromCart` (custom event) | +| The checkout loads | `InitiateCheckout` | +| A shipping address is entered | `AddShippingInfo` (custom event) | +| Payment details are entered | `AddPaymentInfo` | +| The order is paid | `Purchase` | +| 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. + +## Purchases and upsells + +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 | +| 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` | + +The pixel sends nothing when an upsell is accepted. Upsell revenue reaches Meta only through the Meta Pixel app. + +Because the IDs match, Meta keeps one of the two. It usually keeps the first one it receives, which is the browser's, so the amount Meta shows can be the first sale without upsells. If you want Meta to see the full order total, use the server-only option below. + +## Count each purchase once + +Pick one of these. + +**Option 1: pixel and app together (default).** Both report the purchase with the same ID and Meta merges them. This is what the setup above gives you. It only works when `storeName` is exactly your store name. + +**Option 2: app only.** The pixel reports everything except the purchase, and the app is the only one that reports it. Meta then sees the full order total with upsells. Add `blockedEvents` to the `facebook` settings: + +```js title="assets/config.js" +facebook: { + enabled: true, + settings: { pixelId: '123456789012345' }, + blockedEvents: ['dl_purchase'] +} +``` + + +If Meta events are also sent from Google Tag Manager, or from a Shopify app on a Shop Sync store, Meta counts purchases twice. Meta cannot merge two purchases that both come from servers. See [Tracking on Shop Sync stores](/docs/campaigns/tracking/shop-sync). + + +## Optional settings + +### Advanced matching + +Advanced matching sends the shopper's email, phone, name, city, state, postcode and country to Meta through the pixel to improve matching. To turn it on, add this to your campaign in `_data/campaigns.json`: + +```json +"meta_advanced_matching_enabled": "true" +``` + +It is not tied to the marketing opt-in checkbox on your checkout. Turn it on only when your privacy policy covers it. See [Privacy and consent](/docs/campaigns/tracking#privacy-and-consent). + +### More than one pixel + +Each campaign reports to the pixel in its own `fb_pixel_id`, so two campaigns can use two pixels: + +```json title="_data/campaigns.json" +{ + "summer-offer": { + "name": "Summer Offer", + "fb_pixel_id": "123456789012345" + }, + "winter-offer": { + "name": "Winter Offer", + "fb_pixel_id": "987654321098765" + } +} +``` + +Set the same ID as `pixelId` in each campaign's `assets/config.js`. Then add every pixel you use in the Meta Pixel app, before you send traffic to the campaign. See the [Meta Pixel app docs](https://docs.nextcommerce.com/docs/apps/meta-pixel). + +## Verify it works + +1. In Meta Events Manager, open **Test Events** for your pixel. +2. Start the test from that page and go through your campaign in the same browser. You should see `PageView` on each page. +3. Place an order with a [test card](/docs/testing). On the next page you should see `Purchase` with the event ID `your-store-` followed by the order number. + +To test the Meta Pixel app as well: + +1. Turn on **Enable Sending Test Data** in the app. +2. Copy the test code shown in **Test Events** and add this to a campaign page, with your code in place of `TEST12345`: + +```html + +``` + +3. Place another test order and wait 10 minutes. **Test Events** should show a second `Purchase`, from the server, with the same event ID. +4. Remove the snippet and turn **Enable Sending Test Data** off before you launch. + +The app keeps a 30-day log of what it sent, under **Logs** in the app. + +Tips for **Test Events**: + +- **Keep the Test Events page open.** A server purchase that arrives while the page is closed does not show up later. +- **Use the same browser for the campaign.** Browser events only appear when the campaign is opened from Test Events, in that browser. A private window or another browser shows nothing. +- **Check the test code is current.** Meta drops events sent with an expired code without telling you. Copy a fresh code before each session. +- **Two purchases listed is normal.** Test Events lists both the browser and the server purchase. Meta still counts them as one when the event IDs match. + +## Troubleshooting + +| Problem | Likely cause | Fix | +| --- | --- | --- | +| Nothing reaches Meta | `fb_pixel_id` is missing or empty | Add your pixel ID and rebuild | +| The pixel loads but sends no events | `facebook` is switched off in `assets/config.js`, or `pixelId` is empty | Switch it on and set `pixelId` | +| Every purchase counted twice | `storeName` is missing, still `store-name`, or not your exact store name | Set `storeName` correctly, or use option 2 | +| No server purchase for a real order | The campaign's pixel is not added in the app, the order is a subscription renewal, or 10 minutes have not passed | Add the pixel in the app and wait 10 minutes | +| `blockedEvents` does nothing | A Meta event name was used | Use `dl_purchase`, not `Purchase` | + +More help is in [Test and troubleshoot tracking](/docs/campaigns/tracking/testing-and-troubleshooting). + +## Hand-built campaigns + +On a campaign that is not built from a starter template, add Meta's pixel base code to every page yourself, without a `fbq('track', 'PageView')` call, then follow step 2 of Part 1. The Meta Pixel app works the same way for any campaign. diff --git a/content/docs/campaigns/tracking/more-integrations.mdx b/content/docs/campaigns/tracking/more-integrations.mdx new file mode 100644 index 0000000..751c495 --- /dev/null +++ b/content/docs/campaigns/tracking/more-integrations.mdx @@ -0,0 +1,126 @@ +--- +title: More integrations +description: How to turn on TikTok, Snapchat, Pinterest, Taboola, AppLovin Axon, Northbeam, RudderStack and Klaviyo for your NEXT campaign. +sidebar_label: More integrations +audience: [merchant, developer] +last_verified: 2026-11-16 +tags: + - Guide +--- + +Most platforms here are turned on with one line in `_data/campaigns.json`. Add the line to your campaign, then build with `npm run build` and deploy. See [Set up tracking](/docs/campaigns/tracking/getting-started) for the full steps. + +| Platform | Line to add | +| --- | --- | +| [TikTok](#tiktok) | `tiktok_pixel_id` | +| [Snapchat](#snapchat) | `snap_pixel_id` | +| [Pinterest](#pinterest) | `pinterest_tag_id` | +| [Taboola](#taboola) | `taboola_account_id` | +| [AppLovin Axon](#applovin-axon) | `axon_event_key` | +| [Northbeam](#northbeam) | `northbeam_client_id` | +| [RudderStack](#rudderstack) | Two lines and a setting | +| [Klaviyo](#klaviyo) | A store app | + +Everflow has [its own guide](/docs/campaigns/tracking/everflow). + +## TikTok + +```json +"tiktok_pixel_id": "your-pixel-id" +``` + +- **What it tracks:** page views, product views, add to cart, checkout started, payment details and purchases. +- **Upsells:** each accepted upsell counts as another purchase, so an order with two upsells shows as three purchases. To count one purchase per order, add `"tiktok_blocked_events": "dl_upsell_purchase"`. Upsell revenue then does not reach TikTok. +- **Shopper details:** add `"tiktok_advanced_matching_enabled": "true"` to send email and phone. If your checkout has a marketing opt-in checkbox, nothing is sent when it is unticked. + +The **TikTok** app you set up under **Apps** in your NEXT dashboard only adds its script to your Storefront. It is not added to your Campaigns, so add TikTok to your campaign as shown above. + +## Snapchat + +```json +"snap_pixel_id": "your-pixel-id" +``` + +- **What it tracks:** page views, product views, add to cart, checkout started, payment details and purchases. +- **Upsells:** each accepted upsell counts as another purchase. +- **Shopper details:** add `"snap_advanced_matching_enabled": "true"` to send email and phone. If your checkout has a marketing opt-in checkbox, nothing is sent when it is unticked. + +## Pinterest + +```json +"pinterest_tag_id": "your-tag-id" +``` + +- **What it tracks:** page views, add to cart, and a `checkout` event for each order. +- **Upsells:** each accepted upsell counts as another `checkout`. +- **Shopper details:** add `"pinterest_enhanced_match_enabled": "true"` to send email. If your checkout has a marketing opt-in checkbox, nothing is sent when it is unticked. + +## Taboola + +```json +"taboola_account_id": "1234567" +``` + +Use your numeric account ID. + +- **What it tracks:** page views, product views, add to cart, checkout started, payment details and purchases. +- **Upsells:** sent as a separate `upsell_purchase` event. Create a Taboola conversion for it to count upsell revenue. + +The **Taboola Pixel Events** app you set up under **Apps** in your NEXT dashboard only adds its script to your Storefront. It is not added to your Campaigns, so add Taboola to your campaign as shown above. + +## AppLovin Axon + +```json +"axon_event_key": "your-event-key" +``` + +- **What it tracks:** page views, product views, add to cart, checkout started, payment details and purchases. +- **Upsells:** each accepted upsell counts as another purchase. +- **Shopper details:** add `"axon_send_user_data": "true"` to send email, phone and customer ID with the purchase. Turn it on only when your privacy policy covers it. See [Privacy and consent](/docs/campaigns/tracking#privacy-and-consent). +- **Axon's cookie (optional):** AppLovin [recommends](https://support.applovin.com/en/growth/promoting-your-websites/track-and-optimize/google-tag-manager) that your site's server sets Axon's `_axwrt` cookie again as a one-year cookie named `axwrt`. The starter templates do not do this. They are static sites, so it needs your own server in front of the campaign. + +The **AppLovin AXON** app you set up under **Apps** in your NEXT dashboard only adds its script to your Storefront. It is not added to your Campaigns, so add Axon to your campaign as shown above. + +## Northbeam + +```json +"northbeam_client_id": "your-client-id" +``` + +- **What it tracks:** page views, and a purchase for each order. +- **Upsells:** each accepted upsell counts as another purchase. +- **Shopper details:** add `"northbeam_identity_enabled": "true"` to send the shopper's email, which helps Northbeam match orders. + +### Northbeam on a Shop Sync store + +Northbeam already receives your orders from Shopify. Stop the campaign sending them too, and turn identity on: + +```json +"northbeam_client_id": "your-client-id", +"northbeam_identity_enabled": "true", +"northbeam_blocked_events": "dl_purchase, dl_upsell_purchase" +``` + +## RudderStack + +RudderStack needs two lines and one setting. + +```json +"rudderstack_write_key": "your-write-key", +"rudderstack_dataplane_url": "https://your-dataplane-url" +``` + +Then switch `rudderstack` on in `assets/config.js`: + +```js title="assets/config.js" +// Inside analytics.providers: +rudderstack: { + enabled: true +}, +``` + +RudderStack is a pipe, like Google Tag Manager. It reports nothing by itself; the destinations you connect in RudderStack do. It receives the shopper's details along with the events, and each accepted upsell arrives as another `Order Completed`. + +## Klaviyo + +Klaviyo is a store app, not a line in your campaign. Once installed, it sends order events to Klaviyo from NEXT's servers for campaign orders and storefront orders alike. See the [Klaviyo app docs](https://docs.nextcommerce.com/docs/apps/klaviyo). diff --git a/content/docs/campaigns/tracking/shop-sync.mdx b/content/docs/campaigns/tracking/shop-sync.mdx new file mode 100644 index 0000000..4b64733 --- /dev/null +++ b/content/docs/campaigns/tracking/shop-sync.mdx @@ -0,0 +1,79 @@ +--- +title: Tracking on Shop Sync stores +description: How to avoid counting campaign sales twice when Shop Sync copies your NEXT campaign orders into Shopify, and where to find the guide for putting a click ID on the Shopify order. +sidebar_label: Shop Sync stores +audience: [merchant, developer] +last_verified: 2026-11-16 +tags: + - Guide +--- +import { Callout } from 'fumadocs-ui/components/callout'; + +Shop Sync copies your campaign orders into Shopify. That creates one risk for tracking: a sale can be reported twice, once by your campaign and once by a Shopify app that sees the copied order. + +This page shows which Shopify tools see those orders, and what to turn off so each sale is counted once. + +## What Shop Sync puts in Shopify + +Two things matter for tracking: + +- **The order arrives when it is sent for fulfillment**, not at the moment of payment, and it is tagged `NEXT`. +- **It carries no ad details.** There are no UTM parameters, click IDs, referrer or landing page on the Shopify order. + +For everything else about these orders, such as finding one by its PO number or how split shipments are counted, see [Do my NEXT sales show in Shopify analytics?](https://guides.nextcommerce.com/guides/shop-sync-daily-operations#shopify-analytics) in the Shop Sync guide. + +## Which Shopify tools see these orders + +When Shop Sync creates the order, Shopify notifies every app that listens for new orders. Shopify calls that notification a webhook. + +**Any tool that uses Shopify order webhooks creates its own purchase event for the synced order, with its own ID.** It builds that ID from Shopify's order details, which did not exist when your campaign reported the sale. The two IDs can never match, so the ad platform sees two separate purchases and counts both. + +| Tool | Reports campaign orders? | +| --- | --- | +| Tracking apps that send purchases from Shopify order webhooks | Yes, as their own purchase with their own ID | +| Triple Whale and Northbeam, connected to Shopify | Yes, they read the Shopify order | +| Shopify admin and reports | Yes | +| Shopify's own Facebook & Instagram channel | No. It follows the Shopify checkout, which the shopper never used | +| Pixels on your Shopify storefront or checkout | No. The shopper never visits those pages | + +For a tool not listed here, ask one question: does it listen for Shopify orders, or does it only run on Shopify pages? If it listens for orders, it reports campaign sales too. + +## Count each sale once + +For each platform, choose one thing to report the purchase. + +| Platform | Report the purchase from | Turn off | +| --- | --- | --- | +| Meta | Your campaign and the NEXT Meta Pixel app | Any Shopify app that also sends purchases to the same Meta pixel. Exclude orders tagged `NEXT` in that app | +| Triple Whale | Shopify | The campaign's purchase. See [Triple Whale](/docs/campaigns/tracking/triple-whale) | +| Northbeam | Shopify | The campaign's purchase. See [Northbeam](/docs/campaigns/tracking/more-integrations#northbeam-on-a-shop-sync-store) | +| Google Analytics 4 and Google Ads | Your campaign | Any Shopify Google app that also reports these orders. Exclude orders tagged `NEXT` | +| TikTok | Your campaign | Any Shopify TikTok app that also reports these orders. Exclude orders tagged `NEXT` | + + +If a Shopify app sends purchases to Meta and cannot exclude orders tagged `NEXT`, let that app be the only one. Turn off the NEXT Meta Pixel app, and stop the campaign's purchase with `blockedEvents: ['dl_purchase']` as shown in the [Meta](/docs/campaigns/tracking/meta#count-each-purchase-once) guide. + + +To stop the campaign reporting purchases to a platform, add its line to your campaign in `_data/campaigns.json`: + +| Platform | Line | +| --- | --- | +| Triple Whale | `"triplewhale_blocked_events": "dl_purchase, dl_upsell_purchase"` | +| Northbeam | `"northbeam_blocked_events": "dl_purchase, dl_upsell_purchase"` | +| Google Analytics 4 | `"ga4_blocked_events": "dl_purchase, dl_upsell_purchase"` | +| TikTok | `"tiktok_blocked_events": "dl_purchase, dl_upsell_purchase"` | + +Before you launch, place one order, send it for fulfillment, and check each platform shows it once. Repeat this check whenever you install a new Shopify app that tracks orders, because it may start reporting campaign sales too. + +## Put a click ID on the Shopify order + +Shop Sync does not copy ad details to Shopify by itself. You can map individual values, such as a Meta or Google click ID, onto the Shopify order as metafields. + +This is covered step by step in the Shop Sync guide, [Send NEXT order data to Shopify](https://guides.nextcommerce.com/guides/shop-sync-metadata): + +| What you want | Where | +| --- | --- | +| Map any value to a Shopify metafield | [Map a metadata field](https://guides.nextcommerce.com/guides/shop-sync-metadata#mapping) | +| Send the Meta click ID, Meta browser IDs, or the Everflow ID | [Send click IDs to Shopify](https://guides.nextcommerce.com/guides/shop-sync-metadata#click-id) | +| Send the Google click ID | [Google click ID](https://guides.nextcommerce.com/guides/shop-sync-metadata#gclid) | +| Carry a value onto subscription renewals | [Subscriptions](https://guides.nextcommerce.com/guides/shop-sync-metadata#subscriptions) | diff --git a/content/docs/campaigns/tracking/testing-and-troubleshooting.mdx b/content/docs/campaigns/tracking/testing-and-troubleshooting.mdx new file mode 100644 index 0000000..fc9da53 --- /dev/null +++ b/content/docs/campaigns/tracking/testing-and-troubleshooting.mdx @@ -0,0 +1,96 @@ +--- +title: Test and troubleshoot tracking +description: Place a test order on your campaign, check what was reported at each step, and fix the tracking problems that come up most often. +sidebar_label: Testing and troubleshooting +audience: [merchant, developer] +last_verified: 2026-11-16 +tags: + - Guide +--- +import { Callout } from 'fumadocs-ui/components/callout'; + +Use this page to check your tracking before you launch, and to fix it when something is missing. + +## Before you test + +- **Test on a deployed production build.** Build with `npm run build`. The development server (`npm run dev`) leaves tracking out. +- **Use a new private window for each test.** It starts a clean visit, with no ad details left over from an earlier test. +- **Pay with a [test card](/docs/testing).** No money moves. +- **Do not use `?ignore=true`.** It turns tracking off for that browser tab. + + +A test order reports a real-looking purchase to every platform you have turned on. A domain set to **Development** does not stop this; it only keeps the visit out of NEXT's own campaign analytics. Expect your test orders in your ad platform reports. + + +Store apps handle test orders in their own way: + +| Store app | Test orders | +| --- | --- | +| Meta Pixel | Skipped unless **Enable Sending Test Data** is on | +| Everflow | Skipped unless **Enable S2S Postback for test orders** is on | +| Klaviyo | Skipped unless **Enable Sending Test Data to Klaviyo** is on | +| Shop Sync | Sent to Shopify only when you request fulfillment on the order | + +## Run a test order + +1. Open your campaign in a new private window, with test details on the link: + +```text +https://campaign.example.com/?utm_source=test&utm_medium=cpc&utm_campaign=tracking-test&gclid=TEST&fbclid=TEST +``` + +2. Go to checkout. Your platforms should show a page view and a checkout-started event. +3. Enter your details and pay with a test card. +4. Continue to the next page. This is where the purchase is reported. Each platform should show one purchase with your order number. +5. Reload that page. No second purchase should appear. +6. Accept an upsell if you have one. The upsell is reported on the page after it. +7. Open the order in your store dashboard. Its attribution should show the test details from your link. + +Each platform guide has a **Verify it works** section that says where to look in that platform. Developers can also inspect the campaign's events in the browser with the SDK's [debugger](https://cart-sdk.nextcommerce.com/v0.4.43/reference/debugger). + +A payment that fails reports no purchase. Only paid orders are reported. To check this yourself, a store with the Test Gateway can pay with the declining test card in the [testing guide](/docs/admin-api/guides/testing-guide#test-gateway). + +## Check your numbers after launch + +Once you have a few days of live orders, compare the number of orders in NEXT with the purchases each ad platform reports. Use the same days and the same timezone for both. + +The two numbers should be close. If a platform shows noticeably more or fewer purchases than NEXT, see [Common problems](#common-problems). + +## Common problems + +### Nothing is tracked + +| Problem | Cause | Fix | +| --- | --- | --- | +| No platform receives anything | The campaign was built with `npm run dev` | Build with `npm run build` and deploy that | +| No platform receives anything, in one browser tab | `?ignore=true` was used earlier in the tab | Open a new private window | +| One platform receives nothing | Its ID is missing from `_data/campaigns.json` | Add the ID and rebuild | +| GTM or the Meta pixel loads but receives no events | It is switched off in `assets/config.js` | Switch it on. See [Google Tag Manager](/docs/campaigns/tracking/google-tag-manager#set-up) or [Meta](/docs/campaigns/tracking/meta#set-up) | +| Checkout events arrive but no page views or purchases | `analytics.mode` in `assets/config.js` is not `'auto'` | Set it to `'auto'` | +| A store app does nothing on the campaign | Most tracking apps only add their scripts to your Storefront. A few, such as the Meta Pixel app's purchase, also cover campaign orders | Set the platform up with its guide in this section. See the [overview](/docs/campaigns/tracking#how-tracking-works) for the apps that cover campaign orders | +| The checkout itself fails to load the cart | The campaign's domain is not in **Allowed Domains** | Add it in the Campaigns app under **Settings**, then **Allowed Domains** | + +### Purchases are missing + +| Problem | Cause | Fix | +| --- | --- | --- | +| No purchase after a test order | The shopper never reached the page after payment | Continue to the upsell or receipt page | +| No purchase when you reopen an order's page | Each order is reported once | Expected. Place a new test order | +| NEXT campaign analytics shows no sessions | The domain is set to **Development** | Set it to **Production** | + +### Things are counted twice + +| Problem | Cause | Fix | +| --- | --- | --- | +| Every event counted twice on one platform | The platform is set up in the template and also in Google Tag Manager or a page script | Keep one | +| Meta counts each purchase twice | `storeName` in `assets/config.js` is missing or wrong, or a second server sender reports to the same pixel | Set `storeName` to your store name. See [Meta](/docs/campaigns/tracking/meta#count-each-purchase-once) | +| Meta shows two page views per page | A second Meta pixel or your own page view call | Remove the extra one | +| Sales counted twice on a Shop Sync store | The campaign and a Shopify app both report the order | See [Tracking on Shop Sync stores](/docs/campaigns/tracking/shop-sync) | + +### Numbers look wrong + +| Problem | Cause | Fix | +| --- | --- | --- | +| Purchase amount is lower than the order total | The purchase amount is the item prices only, without shipping | Expected. GA4 and Google Tag Manager also receive shipping and tax as separate fields. Other platforms receive the amount alone | +| Upsell revenue is missing, or there are more purchases than orders | Each platform counts upsells in its own way | See **Purchases and upsells** in the platform's guide | +| Ad details are missing on the order | The link lost its parameters, or the shopper moved to another domain or a new tab | Keep the campaign on one domain and keep parameters on your ad links | diff --git a/content/docs/campaigns/tracking/triple-whale.mdx b/content/docs/campaigns/tracking/triple-whale.mdx new file mode 100644 index 0000000..bada97e --- /dev/null +++ b/content/docs/campaigns/tracking/triple-whale.mdx @@ -0,0 +1,117 @@ +--- +title: Triple Whale +description: Track your NEXT campaign in Triple Whale on a store that syncs orders to Shopify. Stores without Shopify can load the pixel but do not get attributed sales yet. +sidebar_label: Triple Whale +audience: [merchant, developer] +last_verified: 2026-11-16 +tags: + - Guide +--- +import { Callout } from 'fumadocs-ui/components/callout'; + +The starter templates include the Triple Whale pixel. Add your Triple Whale details and the pixel loads on every campaign page, so Triple Whale can see the visit. + +This guide is for stores that sync their orders to Shopify with Shop Sync, where Triple Whale gets the sale from Shopify. On a store without Shopify, Triple Whale cannot attribute campaign sales yet. See [Stores without Shopify](#stores-without-shopify). + +## How it works on a Shop Sync store + +1. The pixel on your campaign records the shopper's visit and where they came from. +2. When the shopper enters their email or phone at checkout, the campaign sends it to Triple Whale. +3. Shop Sync creates the order in Shopify, and Triple Whale picks it up from there. +4. Triple Whale uses the email or phone to connect the Shopify order to the campaign visit. + +The campaign does not send the purchase itself. If it did, Triple Whale would see the same sale twice: once from the campaign and once from Shopify. + +## Before you start + +- A Triple Whale account connected to the Shopify store your orders sync to. +- Shop Sync set up, so campaign orders reach Shopify with the `NEXT` tag. See the [Shop Sync onboarding guide](https://guides.nextcommerce.com/guides/shop-sync-onboarding). +- A campaign that is ready for tracking. See [Set up tracking](/docs/campaigns/tracking/getting-started). + +## Set up + +1. In Triple Whale, open **Settings**, then **Business Configurations**, then **Pixel Settings**, and select the **Pixel Installation** tab. Save a **Shopify Headless** Account Setup to see the **Headless Installation** snippet. +2. In the snippet, find `TripleName`. It is your `myshopify.com` domain, for example `your-store.myshopify.com`. Copy it. Do not paste the snippet into your pages; the template already includes it. +3. In `_data/campaigns.json`, add these four lines to your campaign: + +```json title="_data/campaigns.json" +{ + "my-campaign": { + "name": "My Campaign", + "triplewhale_name": "your-store.myshopify.com", + "triplewhale_platform": "SHOPIFY", + "triplewhale_contact_enabled": "true", + "triplewhale_blocked_events": "dl_purchase, dl_upsell_purchase" + } +} +``` + +4. Build with `npm run build` and deploy. + +| Line | What it does | +| --- | --- | +| `triplewhale_name` | Turns the pixel on for your Triple Whale shop | +| `triplewhale_platform` | Ties the campaign to your Shopify store in Triple Whale | +| `triplewhale_contact_enabled` | Sends the shopper's email and phone, so the Shopify order can be connected to the visit | +| `triplewhale_blocked_events` | Stops the campaign sending the purchase, so the sale is counted once | + + +`triplewhale_contact_enabled` sends the shopper's email and phone to Triple Whale as soon as they are entered. It is not tied to the marketing opt-in checkbox. Turn it on only when your privacy policy covers it. See [Privacy and consent](/docs/campaigns/tracking#privacy-and-consent). + + +## What gets tracked + +| When | What Triple Whale receives | +| --- | --- | +| Any page loads | The visit | +| An item is added to the cart | `AddToCart` | +| The shopper enters an email or phone at checkout | `Contact` | +| The order syncs to Shopify | The order, through Triple Whale's Shopify connection | + +The sale appears in Triple Whale after the order syncs to Shopify, not at the moment of payment. An accepted upsell is added to the same NEXT order, so it is included when that order syncs. + + +A shopper who pays with Apple Pay, Google Pay or PayPal may never type an email or phone into the checkout. No `Contact` is sent for them, so Triple Whale may not be able to connect their order to an ad. + + +## Verify it works + +1. Open your campaign in a new private window, with test details on the link, for example `?utm_source=tw-test&utm_campaign=tw-test`. +2. In the browser console, run `TriplePixel('State')`. It should return `"Ready"`. +3. Type an email at checkout and place an order. +4. Check the order reached Shopify with the `NEXT` tag. A [test order](https://docs.nextcommerce.com/docs/manage/orders/test-orders) is not sent to Shopify automatically, so request fulfillment on it in NEXT. It arrives in Shopify marked as a test order. +5. In Triple Whale, find the order by the buyer's email and check the source it is attributed to. + +| What you see in Triple Whale | What it means | +| --- | --- | +| One order, attributed to your test source | Everything is working | +| One order, not attributed | The order arrived from Shopify, but Triple Whale did not connect it to the visit. Check `triplewhale_contact_enabled` is on and the email matches | +| Two orders for one sale | The campaign is still sending the purchase. Check `triplewhale_blocked_events`. If that is set, the order may have shipped in two parts, which [shows as two Shopify orders](https://guides.nextcommerce.com/guides/shop-sync-daily-operations#shopify-analytics) | +| No order | The order has not reached Shopify yet, or Triple Whale is not connected to that Shopify store | + +Triple Whale's Pixel Helper extension only works in a normal Chrome window. In Triple Whale's Pixel Settings, "Online Store: Not Installed" is expected for a campaign. + +## Stores without Shopify + + +Triple Whale attributes a sale by connecting an order record to the shopper's visit. On a Shopify store the order record comes from Shopify. On any other store it has to be sent to [Triple Whale's Orders API](https://triplewhale.readme.io/reference/pixel-setup-guide-for-custom-sales-platform) alongside the pixel's purchase event, and NEXT does not send orders there. Without Shopify, Triple Whale gets the pixel events but no orders, so campaign sales will not be attributed to your ads. + + +You can still load the pixel to see campaign visits in Triple Whale. Add only this line to your campaign, with your campaign's domain as the value, and leave out the other three lines from the Shop Sync setup: + +```json +"triplewhale_name": "campaign.example.com" +``` + +The campaign then sends Triple Whale the visit, add to cart, and each purchase and upsell from the browser. Upsells arrive as an `UpsellPurchase` event. None of these turn into attributed revenue until Triple Whale also receives the order. + +If Triple Whale attribution matters for a store without Shopify, use Shop Sync to send the orders to a Shopify store connected to Triple Whale, and follow the setup above. + +## Troubleshooting + +| Problem | Likely cause | Fix | +| --- | --- | --- | +| The pixel is not on the page | `triplewhale_name` is missing or empty | Add it and rebuild | +| Data lands in the wrong Triple Whale shop | `triplewhale_name` does not match your Triple Whale snippet | Copy `TripleName` from the snippet again | +| Visits show in Triple Whale but no sales are attributed, on a store without Shopify | Triple Whale gets no order record for the campaign's sales | Not supported yet. See [Stores without Shopify](#stores-without-shopify) | +| Meta counts each order twice | Triple Whale Sonar and the NEXT Meta Pixel app both send it to Meta | Exclude orders tagged `NEXT` in Sonar, or use only one of the two | diff --git a/content/docs/storefront/checkout-links.mdx b/content/docs/storefront/checkout-links.mdx index 6542fc1..31d2f2b 100644 --- a/content/docs/storefront/checkout-links.mdx +++ b/content/docs/storefront/checkout-links.mdx @@ -38,7 +38,7 @@ Checkout link parameters can be broadly split into two groups, [Cart Parameters] ### Attribution Parameters -In addition to populating the cart, you can pass attribution parameters to attribute the order to your marketing channel. +In addition to populating the cart, you can pass attribution parameters to attribute the order to your marketing channel. Campaigns capture a similar set from the landing URL; see [Tracking](/docs/campaigns/tracking#for-developers). | Parameter | Description | | -----------| -------- | @@ -48,7 +48,7 @@ In addition to populating the cart, you can pass attribution parameters to attri | `utm_term` | Identify the paid keywords | | `utm_content` | Use to differentiate ads | | `funnel` | Use to attribute funnels | -| `gclid` | Adwords click ID | +| `gclid` | Google Ads click ID | | `evclid` | Everflow Click ID | | `aff` | Main affiliate / network | | `sub1` | Sub affiliate 1 | diff --git a/content/docs/storefront/event-tracking.mdx b/content/docs/storefront/event-tracking.mdx index 5959036..bccaa88 100644 --- a/content/docs/storefront/event-tracking.mdx +++ b/content/docs/storefront/event-tracking.mdx @@ -4,11 +4,16 @@ description: Subscribe to storefront customer events with JavaScript event track sidebar_label: Event Tracking sidebar_position: 3 --- +import { Callout } from 'fumadocs-ui/components/callout'; ## Overview Event Tracking allows merchants and third-party integrations to subscribe to customer engagement events on your storefront for robust customer behavior tracking. + +These events fire on the NEXT Storefront only. Campaigns built with the Campaign Cart SDK emit their own events. See [Tracking](/docs/campaigns/tracking). + + ## Getting Started To add new custom Event Trackers, in your store go to Settings > Tracking Events > Add Event Tracker.