Skip to main content
Next Commerce and ClickFlare Integration Next Commerce is an e-commerce platform for direct-to-consumer brands. It runs your storefront, checkout, upsells and subscriptions, and it saves marketing attribution with every order. ClickFlare tracks the ad click. This guide connects the two so every Next Commerce order is attributed to the campaign, traffic source and ad that brought the buyer. The ClickFlare click ID goes into Next Commerce in the sub1 parameter, Next Commerce stores it on the order, and the order comes back to ClickFlare in one of two ways:
  • Server-side (recommended): the order.created webhook sends the order, with its attribution, to Zapier or Make, which calls your ClickFlare postback.
  • Browser: a checkout_completed event tracker in your store calls the postback from the buyer’s browser.
The server-side route is more reliable. It runs on Next Commerce’s servers, so ad blockers and buyers who leave before the confirmation page loads don’t lose the order, and Next Commerce retries it if the first delivery fails. It also covers orders from custom funnels built on the Admin API, as long as they pass the same attribution values.

At a glance

To set up Next Commerce with ClickFlare:
  1. Set up a tracking domain and campaign.
  2. Create the store as an offer with sub1.
  3. Create the catch URL and webhook.
  4. Place a test order.
  5. Send the postback.
Each step is explained in Setup.

How the data flows


What you’ll need

  • A ClickFlare account with your own tracking domain. Shared domains get flagged by ad platforms and blocked by browsers. See Tracking domains.
  • Access to Settings in your Next Commerce store.
  • For the server-side route: a Zapier or Make account. See the Zapier and Make guides.

Setup

1

Set up your own tracking domain

Add a custom tracking domain such as trk.yourdomain.com before anything else. The postback is built on it. See Tracking domains.
2

Create the custom conversion (optional)

Go to Settings → Custom Conversions, click Add and create Sale with the parameter sale, Include in Conversions and Include in Revenue turned on. Add Upsell (upsell) too if you report upsells separately. The value in ct must match exactly. See Custom conversions.
3

Create the campaign

Go to Campaigns → New Campaign, pick your traffic source and tracking domain, and choose Redirect tracking. This setup needs the click ID in the URL that reaches Next Commerce, which a redirect campaign provides. See Creating a campaign.
4

Create the store as an offer with sub1

In the campaign path, create the offer inline with your store, product page or checkout link and the click ID in sub1:
A checkout link works too: https://yourstore.com/checkout/add/?product=12:1&sub1={cf_click_id}. Next Commerce reads attribution on storefront checkout and product pages.
Keep the braces: {cf_click_id}. Without them Next Commerce stores the literal text cf_click_id in subaffiliate1.
If you run a lander first, its CTA must link to the ClickFlare click URL. Save the campaign and use its URL in your ads.
5

Choose how the order reaches ClickFlare

Set up one of the two routes below. Don’t run both, or each order is counted twice.

Route 1: order.created webhook

Next Commerce sends webhooks as a fixed JSON body with its own field names, and the receiving URL must answer with a 200 status. Zapier or Make sits in between and turns it into a ClickFlare postback.
1

Create the catch URL

In Zapier, start a Zap with Webhooks by Zapier → Catch Hook. In Make, start a scenario with a Custom webhook. Copy the URL.
2

Create the webhook in Next Commerce

Go to Settings → Webhooks and choose Create Webhook. Paste the catch URL as the target and select the order.created event trigger. Save.
3

Place a test order

Click through your ClickFlare campaign URL and place an order. In Zapier or Make, open the received payload. Under data, find number, total_incl_tax and the attribution object with subaffiliate1, which should hold your click ID.
4

Send the postback

Add an action that calls your postback with a GET request (Webhooks by Zapier → GET, or Make’s HTTP → Make a request):
Map each placeholder to the field from the payload. Add a filter so the action only runs when subaffiliate1 has a value; orders without a ClickFlare click have nothing to match. Turn the Zap or scenario on.
If a delivery doesn’t get a 200 response, Next Commerce retries it up to 10 times over several days. Because the postback carries the order number as txid, a retried order replaces itself in ClickFlare instead of counting twice. You can check deliveries under Settings → Webhooks, then Actions → Detail on the webhook.
ClickFlare also accepts a JSON POST to /cf/cv with cf_click_id, payout, txid, ct and param1 to param20, for example {"cf_click_id": "SUBAFFILIATE1", "payout": "TOTAL_INCL_TAX", "txid": "NUMBER", "ct": "sale"} with the same fields mapped. Either form works. Keep the order number in txid: it is what keeps retries from double counting. See Postback parameters.

Route 2: checkout_completed event tracker

Event trackers are JavaScript that runs in the buyer’s browser and subscribes to storefront events. No Zapier or Make needed, but ad blockers can stop it, and it only covers storefront checkouts. Go to Settings → Tracking Events → Add Event Tracker and paste:
Replace trk.yourdomain.com with your tracking domain, and remove &ct=sale if you skipped the custom conversion. Event trackers are pure JavaScript, so don’t wrap the code in <script> tags.

Attribution behavior

How Next Commerce keeps the click ID decides which click gets the order:
  • Last click by default. A returning visitor’s new link overwrites the earlier values. To keep the first click instead, add clear_attribution=false to the offer URL. New values are then added next to the old ones, and a repeated key such as sub1 still takes the newest value.
  • One-day cookie. sub1 is kept in the AffiliateData cookie, which expires after one day. A buyer who comes back later without a new click loses it.
  • Saved on the cart. Attribution moves from the cookie to the store’s database when a cart is created and linked to a customer, and from there onto the order.
You can use sub2 to sub5 for other values, for example sub2={campaign_id}. If you use a different sub for the click ID, change subaffiliate1 to match in the postback.

Upsells and test orders

  • Upsells: order lines carry an is_upsell flag. If your funnel adds post-purchase upsells to the order after order.created fires, they won’t be in that first payload. Test one upsell order and check whether it arrives as an order.updated event before you build on it. Send upsells with their own ct=upsell and a txid such as NUMBER-upsell.
  • Test orders: Next Commerce’s sample order data includes an is_test flag. If your payload has it, add a filter on it in Zapier or Make so test orders stay out of ClickFlare.
  • Currency: total_incl_tax is in the order’s currency. The order.created payload also has a reporting_values object with totals for reporting. If you sell in several currencies, check which one fits your ClickFlare offer currency.

Verify the setup

1

Click through the campaign

Open the ClickFlare campaign URL. The Next Commerce URL should show sub1= followed by a long ID, not the text {cf_click_id}.
2

Place a test order

Complete checkout. For Route 1, check the webhook’s delivery log. For Route 2, look in the browser’s network tab for the request to /cf/cv.
3

Check ClickFlare

The order should appear on the campaign with its revenue. In Logs → Event Logs, check that txid is the order number.

Troubleshooting

  • The offer URL is missing sub1={cf_click_id}, or the lander CTA links straight to the store instead of the ClickFlare click URL.
  • More than a day passed between the click and the order, and the AffiliateData cookie expired.
  • A later visit through another link replaced the value (last click). Use clear_attribution=false if you want the first click kept.
The target must accept JSON and answer with 200 within about 20 seconds. Check the delivery log under Settings → Webhooks, and check that the Zap or scenario is turned on.
Both routes are active, or the postback has no txid. Keep one route and send the order number as txid.
The postback reached ClickFlare with a value that matches no click. Check that it sends subaffiliate1, not another sub field, and see Troubleshooting S2S postbacks.

FAQ

Yes. You pass the ClickFlare click ID in sub1, Next Commerce saves it on the order, and the order.created webhook or a checkout_completed tracker reports the order to ClickFlare.
This setup needs the click ID in the link that reaches Next Commerce. With Google Ads, send the ad to a lander you control that runs the ClickFlare direct tracking script, and point its CTA at the ClickFlare click URL. ClickFlare then adds sub1 on the way to the store. See Direct tracking.
Not by this setup. It reports new orders only. Adjust refunds in ClickFlare if you need net revenue.
Yes. Once ClickFlare records the order, it can pass it to the traffic source through that source’s postback or conversion API integration.

Make

Map webhooks to postbacks

S2S postback

How postbacks work

Checkout Champ

Another DTC checkout