> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# BigCommerce and ClickFlare Integration Guide

> Track BigCommerce orders in ClickFlare: load the tracking script with Script Manager and report each order from Affiliate Conversion Tracking.

![BigCommerce and ClickFlare Integration](https://mintcdn.com/clickflare/gS923ib4WFySqxSL/images/integrations/covers/bigcommerce.png?fit=max\&auto=format\&n=gS923ib4WFySqxSL\&q=85\&s=a135ffe0818d1f95819ea21f2fbd36ff)

BigCommerce is a hosted e-commerce platform. Your store, cart, checkout and order confirmation page all run on BigCommerce, and you can add your own scripts to them without editing the theme.

ClickFlare tracks the ad click. This guide connects the two so every BigCommerce order is attributed to the campaign, traffic source and ad that brought the buyer. Data moves one way: from the visitor's browser on your store to ClickFlare.

* **The ClickFlare script** loads on your storefront through BigCommerce's **Script Manager** and keeps the visitor's click ID in the browser.
* **A conversion script** in BigCommerce's **Affiliate Conversion Tracking** box runs on the order confirmation page and reports the order to ClickFlare with BigCommerce's order ID and order amount.

> [!NOTE]
>
> Server-side reporting is usually more reliable than a browser script, because ad blockers and cookie limits can't stop it. BigCommerce can't do it on its own here: its order webhooks carry only the order ID, with no click ID and no total. See [Why not a webhook](#why-not-a-webhook).

***

## At a glance

To set up BigCommerce with ClickFlare:

1. Create the campaign.
2. Create the store as an offer.
3. Add the script in Script Manager.
4. Edit the conversion script.
5. Add it to Affiliate Conversion Tracking.

Each step is explained in [Setup](#setup).

| | BigCommerce + ClickFlare |
| - | - |
| **How it connects** | Script Manager script + Affiliate Conversion Tracking |
| **What reaches ClickFlare** | Visits, orders, order amount and order ID |
| **Timing** | Real time, when the confirmation page loads |
| **Key parameters** | `click_id={cf_click_id}`, `cpid`, `%%ORDER_AMOUNT%%`, `%%ORDER_ID%%` |
| **Works with** | Stencil or Catalyst 1.1+, redirect or direct campaigns |
| **Good to know** | Needs Optimized One-Page Checkout turned on. |

***

## How the data flows

```text theme={null}
Ad click
  → https://trk.yourdomain.com/cf/r/CAMPAIGN?...        (redirect campaign)
     or the ad links straight to the store                 (direct campaign)
  → https://yourstore.com/?click_id=CF_CLICK_ID&cpid=CAMPAIGN_ID
     (the ClickFlare script on the storefront records the visit
      and keeps the click ID in the browser)
  → Product page → cart → BigCommerce checkout
  → Order confirmation page
     (Affiliate Conversion Tracking runs the ClickFlare conversion script:
      https://trk.yourdomain.com/cf/cv?payout=%%ORDER_AMOUNT%%&txid=%%ORDER_ID%%
      and the script adds the click ID it finds in the browser)
  → ClickFlare matches the order to the original click
```

| Piece | Where it lives in BigCommerce | What it does |
| - | - | - |
| ClickFlare tracking script | **Storefront → Script Manager** | Records the visit and keeps the click ID |
| Conversion script | **Affiliate Conversion Tracking** | Reports the order when the confirmation page loads |
| `%%ORDER_AMOUNT%%` | Conversion tracking variable | Order value, sent as `payout` |
| `%%ORDER_ID%%` | Conversion tracking variable | Order number, sent as `txid` |

***

## 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](/docs/en/settings/tracking-domains.md).
* Admin access to the BigCommerce control panel, including **Storefront** and **Advanced Settings**.
* A **Stencil** storefront (or Catalyst 1.1 or later) with **Optimized One-Page Checkout** turned on. BigCommerce only renders scripts on the checkout and order confirmation pages with that checkout type. It is the default for new Stencil stores; older stores have to switch manually. Legacy Blueprint themes don't render Script Manager scripts at all.

***

## Setup

**1. Set up your own tracking domain**

Add a custom tracking domain such as `trk.yourdomain.com` before anything else. The tracking script and the conversion script are both loaded from it, and the conversion script only finds the click ID when both use the same domain as the campaign. See [Tracking domains](/docs/en/settings/tracking-domains.md).

**2. Create the custom conversion (optional)**

If you want orders in their own column, go to **Settings → Custom Conversions**, click **Add** and create **Sale** with the parameter `sale`. Turn on **Include in Conversions** and **Include in Revenue**. You'll add `ct=sale` to the conversion script later; the two must match exactly. See [Custom conversions](/docs/en/settings/custom-conversions.md).

Skip this step if the default conversion column is enough.

**3. Create the campaign**

Go to **Campaigns → New Campaign**, pick your traffic source and your tracking domain, and choose the tracking method:

* **Redirect** if your traffic source allows redirects. It lets you rotate landers and stores.
* **Direct** for Google Ads and other sources that don't allow redirects. The ad links straight to the store, and the ClickFlare script on the store records the visit.

Create one campaign per traffic source. See [Creating a campaign](/docs/en/campaigns/creating-a-campaign-in-click-flare.md).

**4. Create the store as an offer**

In the campaign path, create a new offer inline. Paste your store URL, or a product page URL, and add the ClickFlare tokens:

```text theme={null}
https://yourstore.com/?click_id={cf_click_id}&cpid={campaign_id}
```

For a direct campaign, turn on the **Direct Tracking** switch in the offer. Direct tracking doesn't work with it off.

> [!WARNING]
>
> Keep the braces: `{cf_click_id}`. Without them the store receives the literal text `cf_click_id` and the order can't be matched to a click.

If you run a lander first, its CTA must link to the ClickFlare **click URL**, not to the store. Save the campaign, then copy the tracking script and the campaign URL from its **Tracking** tab.

**5. Add the ClickFlare script in Script Manager**

In BigCommerce, go to **Storefront → Script Manager**. If you don't see it, go to **Channel Manager** and click **Scripts** in **Quick Links**. Click **Create a Script** and set:

| Field | Value |
| - | - |
| **Name of Script** | `ClickFlare` |
| **Location on page** | **Footer** (BigCommerce recommends footer over head for the widest theme support) |
| **Select pages where script will be added** | The storefront pages, or all pages |
| **Script type** | **Script** |
| **Script contents** | The ClickFlare script from the campaign's **Tracking** tab |

The script looks like this, with your own domain:

```html theme={null}
<script async defer src="https://trk.yourdomain.com/cf/scripts/direct?cpid=CAMPAIGN_ID"></script>
```

Click **Save**. The script is live as soon as you save; BigCommerce takes about 20 seconds to cache it. See [Direct tracking](/docs/en/tracking/direct-tracking-clickflare.md).

> [!NOTE]
>
> BigCommerce requires a subresource integrity (SRI) hash for every script that loads on the **checkout** page, to meet PCI 4.0. The visit is recorded when the buyer lands, so the tracking script doesn't need to run on the checkout. If you choose **All pages** and the script doesn't run on the checkout, that is expected.

**6. Get the conversion script from ClickFlare**

In ClickFlare, go to **Settings → Tracking URLs** and copy the JavaScript version of the conversion tracking script. It reads the click ID from the visitor's browser, so you don't put one in the URL. See [Conversion tracking pixel](/docs/en/settings/conversion-tracking-pixel.md).

Inside the script, edit the URL so it carries BigCommerce's variables, and remove the `click_id=OPTIONAL` placeholder:

```text theme={null}
https://trk.yourdomain.com/cf/cv?payout=%%ORDER_AMOUNT%%&txid=%%ORDER_ID%%&ct=sale
```

Leave out `&ct=sale` if you skipped the custom conversion.

**7. Add it to Affiliate Conversion Tracking**

BigCommerce runs scripts in **Affiliate Conversion Tracking** on the order confirmation page only. Depending on your control panel, it is under:

* **Advanced Settings → Data Solutions**: choose **Affiliate Conversion Tracking**, click **Connect**, and paste the script in **Conversion Tracking Code**, or
* **Advanced Settings → Web Analytics → Affiliate Conversion Tracking**.

Paste the edited script and save. BigCommerce replaces `%%ORDER_AMOUNT%%` and `%%ORDER_ID%%` with the real values on every order.

**8. Add an organic campaign (optional)**

Orders from SEO, email or direct visits have no ad click. To count them too, duplicate the campaign, assign a traffic source called **Organic**, and use its campaign ID in the `cpid` of the Script Manager script. Without `cpid` the script only tracks visitors who arrive from a ClickFlare link.

***

## Order variables

BigCommerce fills these variables into the Affiliate Conversion Tracking code:

| Variable | Value | Use it for |
| - | - | - |
| `%%ORDER_AMOUNT%%` | The order amount | `payout` |
| `%%ORDER_SUBTOTAL%%` | The order subtotal | `payout`, if you want to report the subtotal instead |
| `%%ORDER_ID%%` | The BigCommerce order number | `txid` |

Use `%%ORDER_ID%%` as the transaction ID. ClickFlare keeps one conversion per click ID unless the transaction ID differs, so a buyer who reloads the confirmation page sends the same order ID again and isn't counted twice, while a second order from the same click has a new ID and counts on its own.

The variables carry no currency. Set the offer's payout currency in ClickFlare to your store currency.

***

## Why not a webhook

BigCommerce has order webhooks, including `store/order/created`, `store/order/statusUpdated` and `store/order/refund/created`. Their payloads carry the order ID and, for status changes, the old and new status ID. They don't carry the order total, and BigCommerce doesn't store the ClickFlare click ID on the order.

To report orders server-side, a developer would need to save the click ID on the order during checkout, catch the webhook, look up the order through the BigCommerce API and then send the postback. That isn't covered here. The confirmation page script needs no code beyond the steps above.

What the browser route means in practice:

* An ad blocker or a browser that blocks the script can stop a conversion from being reported.
* The buyer has to reach the order confirmation page.
* Refunds and cancellations are not reported. Adjust them in ClickFlare if you need net revenue.

***

## Verify the setup

**1. Click through the campaign**

Open the ClickFlare campaign URL in a private window. The store URL should show `click_id=` followed by a long ID, not the text `{cf_click_id}`.

**2. Check the scripts load**

View the page source or your browser's network tab and look for the request to `/cf/scripts/` on your tracking domain.

**3. Place a test order**

Use a test payment gateway or a low-priced product. On the confirmation page, look in the network tab for the request to `/cf/cv` with a real amount and order number in place of the variables.

**4. Check the conversion in ClickFlare**

The order should appear on the campaign with its revenue. In **Logs → Event Logs**, check that it arrived with the BigCommerce order number as `txid`.

***

## Troubleshooting

> [accordion] No conversions arrive
>
> * Check that **Optimized One-Page Checkout** is turned on. Without it, Affiliate Conversion Tracking scripts don't render on the confirmation page.
> * Check that the conversion script uses your own tracking domain, the same one as the campaign.
> * Check that the visitor came through the ClickFlare campaign URL. A direct visit to the store has no click ID unless you set up an organic campaign.
> * Turn off ad blockers while testing.

> [accordion] The tracking script doesn't load
>
> * The theme must contain `{{footer.scripts}}` (or `{{head.scripts}}` for a head script). Marketplace Stencil themes do; a custom theme may not.
> * Blueprint themes don't render Script Manager scripts.
> * On Catalyst, scripts load deferred and may not run on client-side page changes. Check the first page the buyer lands on.

> [accordion] The conversion has no revenue or shows %%ORDER\_AMOUNT%%
>
> The variables are only replaced inside Affiliate Conversion Tracking. A script placed in Script Manager on the confirmation page sends the variable names as text. Move it to Affiliate Conversion Tracking.

> [accordion] Conversions arrive without a campaign
>
> The conversion reached ClickFlare without a click ID. Check that the tracking script and the conversion script use the same domain as the campaign, and that the offer URL has `click_id={cf_click_id}` with braces. See [Troubleshooting S2S postbacks](/docs/en/tracking/troubleshooting-s2s-postback-url-in-clickflare.md) for the general checks.

***

## FAQ

> [accordion] Does ClickFlare integrate with BigCommerce?
>
> Yes. The ClickFlare script loads on your storefront through Script Manager, and a conversion script in Affiliate Conversion Tracking reports each order with its amount and order ID.

> [accordion] Does this work with Google Ads?
>
> Yes. Use a direct campaign. The ad links straight to the store, and the ClickFlare script records the visit without a redirect.

> [accordion] Can I report each product separately?
>
> Not with the variables alone: they describe the whole order. BigCommerce's Storefront API returns the order's line items at `/api/storefront/order/` followed by the order ID, and some partners call it from the same Affiliate Conversion Tracking box to read products. Doing that for ClickFlare is custom code; test it carefully before relying on it.

> [accordion] Can I send the order back to my traffic source?
>
> Yes. Once ClickFlare records the order, it can pass it to the traffic source through that source's postback or conversion API integration. Nothing changes on the BigCommerce side.

> [accordion] Can I use Zapier or Make instead?
>
> Only if the click ID reaches them. BigCommerce's order data doesn't include it by default, so an automation would have no click ID to send.

***

## Related

> [card] [Direct tracking](/docs/en/tracking/direct-tracking-clickflare.md)
>
> How the on-page script works

> [card] [Conversion pixel](/docs/en/settings/conversion-tracking-pixel.md)
>
> Get the conversion script

> [card] [Shopify](/docs/en/integrations/how-to-track-your-shopify-store-with-click-flare-from-product-views-to-final-sale.md)
>
> The same idea on Shopify


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.