Test and troubleshoot tracking
Place a test order on your campaign, check what was reported at each step, and fix the tracking problems that come up most often.
Use this page to check your tracking before you launch, and to fix it when something is missing.
This page is for campaigns on Campaign Cart SDK 0.5.2, the version the starter templates load. Where a campaign still on SDK 0.4.x behaves differently, the page says so. The SDK version is in your campaign's _data/campaigns.json as sdk_version.
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. No money moves.
- Do not use
?ignore=true. It turns tracking off for that browser tab. Open a page with?ignore=falseto turn it back on.
Test orders reach your ad platforms
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
- Open your campaign in a new private window, with test details on the link:
https://campaign.example.com/?utm_source=test&utm_medium=cpc&utm_campaign=tracking-test&gclid=TEST&fbclid=TEST- Go to checkout. Your platforms should show a page view and a checkout-started event.
- Enter your details and pay with a test card.
- Check the purchase. Each platform should show one purchase with your order number. On SDK 0.5.2 it is reported on the checkout page as soon as the payment goes through. On SDK 0.4.x it is reported on the next page, so continue to it.
- Reload the page. No second purchase should appear.
- Accept an upsell if you have one. The upsell is reported on the page after it.
- 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.
See what the campaign sent
On SDK 0.5.2, add ?debug=1 to the end of any campaign link. The SDK's debug panel opens, and stays open in that tab as you move through the funnel. Its Analytics tab lists each event the page sent, what it carried, which platforms it reached, and why an event was not sent. Open a page with ?debug=0 to close it. See See what was sent.
On SDK 0.4.x, use the 0.4.43 debugger instead.
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.
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
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 or Meta |
| Checkout events arrive but no page views or purchases, on SDK 0.4.x | analytics.mode in assets/config.js is not 'auto' | Set it to 'auto'. SDK 0.5.2 ignores this setting |
| One event never reaches one platform | The event is on that platform's block list: blockedEvents in assets/config.js for GTM, Meta and RudderStack, or a setting such as ga4_blocked_events in _data/campaigns.json for the others | Remove it from the list. The platform's guide shows where its list is, for example Google Tag Manager, Meta or Google Analytics 4 |
| 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 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, on SDK 0.4.x | The shopper never reached the page after payment | Continue to the upsell or receipt page |
| No purchase after a test order, on SDK 0.5.2 | The shopper paid away from the page, for example with PayPal, and has not come back to the campaign, or left the checkout before the purchase was sent | The purchase is sent on the first campaign page they open next. 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 |
| 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 |
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 |