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

# SamCart and ClickFlare Integration Guide

> Track SamCart sales in ClickFlare: pass the click ID on the checkout link and report orders, bumps, upsells and refunds by webhook or order script.

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

SamCart is a checkout and sales page platform. It hosts your checkout pages, order bumps, one-click upsells and the order summary page.

ClickFlare tracks the ad click. This guide connects the two so every SamCart sale is attributed to the campaign, traffic source and ad that brought the buyer. Data moves from SamCart to ClickFlare, in one of two ways:

* **Server-side (recommended):** SamCart's webhook sends each order to Zapier or Make, which reads the click ID SamCart saved with the order and calls your ClickFlare postback.
* **Browser:** an order script in each SamCart product fires a conversion to ClickFlare when the buyer reaches the order summary page.

The server-side route is more reliable. It runs on SamCart's servers, so ad blockers, cookie limits and buyers who close the tab before the order summary loads don't lose the sale. It is also the only route that can report refunds.

***

## At a glance

To set up SamCart with ClickFlare:

1. Add a tracking domain and conversions.
2. Create the campaign and SamCart offer.
3. Install Webhooks in SamCart.
4. Add the webhook rules.
5. Send the postback to ClickFlare.

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

| | SamCart + ClickFlare |
| - | - |
| **How it connects** | SamCart webhook via Zapier or Make, or order script |
| **What reaches ClickFlare** | Sales, upsells, refunds, order total, order ID |
| **Timing** | Real time, per conversion |
| **Key parameters** | `click_id`, `payout`, `txid`, `ct` |
| **Works with** | Checkouts, order bumps and one-click upsells |
| **Good to know** | Use one route per product, or each sale is counted twice. |

***

## How the data flows

```text theme={null}
Ad click
  → https://trk.yourdomain.com/cf/r/CAMPAIGN?...
     (ClickFlare records the click and generates the click ID)
  → [optional lander → CTA uses the ClickFlare click URL]
  → https://checkout.samcart.com/products/your-product?click_id=CF_CLICK_ID
     (SamCart captures every parameter on the link and saves it with the order)
  → Buyer pays, adds the bump, accepts upsells

Server-side:
  → SamCart webhook rule (Order completed, Upsell purchased, Product refunded)
  → Zapier or Make reads the click ID from the order's attribution data
  → https://trk.yourdomain.com/cf/cv?click_id=CF_CLICK_ID&payout=TOTAL&txid=ORDER_ID&ct=sale

Browser:
  → Order summary page renders each product's order script
  → https://trk.yourdomain.com/cf/cv?payout=##total_amount##&txid=##order_id##
     (the script adds the click ID it finds in the browser)
```

| | Server-side (webhook) | Browser (order script) |
| - | - | - |
| Where it's set up | **Apps → Webhooks** + Zapier or Make | Each product's **Advanced** tab |
| Click ID comes from | The order's attribution data | A cookie in the buyer's browser |
| Blocked by ad blockers | No | Can be |
| Refunds | Yes | No |
| Extra tool | Zapier or Make | None |

***

## 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).
* Access to your SamCart marketplace settings, products and **Apps**.
* For the server-side route: a Zapier or Make account. See the [Zapier](/docs/en/integrations/zapier-click-flare-integration-guide.md) and [Make](/docs/en/integrations/make-click-flare-integration-guide.md) guides.

***

## Setup

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

Add a custom tracking domain such as `trk.yourdomain.com` before anything else. The postback and the scripts are built on it. See [Tracking domains](/docs/en/settings/tracking-domains.md).

**2. Create the custom conversions**

Go to **Settings → Custom Conversions** and click **Add** for each event you want as its own column. The parameter is the value you send in `ct`, and the two must match exactly.

| Name | Parameter | Settings |
| - | - | - |
| Sale | `sale` | **Include in Conversions** and **Include in Revenue** |
| Upsell | `upsell` | **Include in Revenue** |
| Refund | `refund` | **Include in Revenue**, server-side route only |

See [Custom conversions](/docs/en/settings/custom-conversions.md).

**3. Create the campaign and the SamCart offer**

Go to **Campaigns → New Campaign**, pick your traffic source and tracking domain, and choose **Redirect** tracking. In the path, create the offer inline with your SamCart checkout link and the click ID:

```text theme={null}
https://checkout.samcart.com/products/your-product?click_id={cf_click_id}
```

SamCart captures any parameter on the checkout link, not only UTM tags, and shows it on the order under **Show all parameters**. You don't need to set anything up in SamCart for this.

> [!WARNING]
>
> Keep the braces: `{cf_click_id}`. Without them SamCart saves the literal text `cf_click_id` and nothing can be matched.

If you run a lander first, its CTA must link to the ClickFlare **click URL**. If your checkout is embedded on your own site or opens as a slide-in, add SamCart's landing page script to the page your ads link to, so the parameters carry into the checkout. Save the campaign and use its URL in your ads. See [Creating a campaign](/docs/en/campaigns/creating-a-campaign-in-click-flare.md).

**4. Choose how SamCart reports the sale**

Set up one of the two routes below. Don't run both for the same product, or each sale is reported twice.

***

## Route 1: Webhook through Zapier or Make

SamCart's webhook sends a fixed JSON body with its own field names, so it can't post to ClickFlare directly. 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 it gives you.

**2. Install Webhooks in SamCart**

In SamCart, click **Apps** in the left navigation, search for **Webhooks** and click **Install**. Paste the catch URL as the **Notify URL**, including `https://`, and click **Connect**.

**3. Add the rules**

On the Webhooks page, click **+ Add New Rule**. Choose **Global Rule** for all products or **Product Specific Rule**, then pick the action and trigger:

| Event in ClickFlare | Action | Trigger |
| - | - | - |
| `sale` | **Send NotifyURL Post for Orders** | **Order completed** |
| `upsell` (optional) | **Send NotifyURL Post** | **Upsell purchased** |
| `refund` (optional) | **Send NotifyURL Post** | **Product refunded** |

**Order completed** sends the whole order once, with every product in it. Its `order.total` is the full basket. If you also send upsells separately, report the sale with the front-end value instead, or the upsell revenue counts twice.

**4. Place a test order and find the click ID**

Click through your ClickFlare campaign URL and buy in Test Mode. Open the received request in Zapier or Make. SamCart sends attribution data in an `attribution_enhanced` object. Find your `click_id` value in it and note the field path. SamCart doesn't document the exact layout of that object, so map it from a real sample.

**5. Send the postback to ClickFlare**

Add an action that calls your postback with a **GET** request (**Webhooks by Zapier → GET**, or Make's **HTTP → Make a request**):

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

Map `CLICK_ID` to the field you found, `ORDER_TOTAL` to `order.total` and `ORDER_ID` to `order.id`. For upsells use `ct=upsell`, the product's `price` as payout and `ORDER_ID-PRODUCT_ID` as `txid`, so each upsell on the same order stays a separate conversion. Turn the Zap or scenario on.

> [!NOTE]
>
> 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": "CLICK_ID", "payout": "ORDER_TOTAL", "txid": "ORDER_ID", "ct": "sale"}` with the same fields mapped. Either form works. Keep the order ID in `txid`: it keeps repeated deliveries from counting twice. See [Postback parameters](/docs/en/tracking/click-flare-parameters-in-postback-urls.md).

### Refunds

Send refunds as their own conversion with `ct=refund` and a negative payout, for example `payout=-47.00`. A different `ct` adds a new row instead of replacing the sale, so the refund stays visible in its own column and net revenue drops. SamCart sends partial refunds as a separate trigger, **Product partially refunded**.

SamCart notes that refund events carry less data than orders. Check a real refund in your Zap: if it has no attribution data, the Zap has to find the click ID another way, for example by looking up the original order.

***

## Route 2: Order script in SamCart

**1. Add the ClickFlare script to every checkout**

Copy the tracking script from the campaign's **Tracking** tab. In SamCart, click the person icon (or your logo) at the top right, choose **Settings**, open **Tracking and Pixels** and paste it in **Embed HTML/Scripts in Header** on its own line. Click **Save Changes**. SamCart adds it to the header of every checkout.

**2. Add the conversion script to each product**

In ClickFlare, go to **Settings → Tracking URLs** and copy the JavaScript conversion script. Remove the `click_id=OPTIONAL` placeholder and put SamCart short codes in the URL:

```text theme={null}
https://trk.yourdomain.com/cf/cv?payout=##total_amount##&txid=##order_id##&ct=sale
```

In SamCart, open the product, go to its **Advanced** tab and paste the script in **Fire Pixels/Scripts After An Order is Completed**. SamCart renders it whenever that product is part of a purchase. See [Conversion tracking pixel](/docs/en/settings/conversion-tracking-pixel.md).

**3. Add scripts to bump and upsell products**

An order with a bump or upsell fires the script of every product in it. Give the main product the `##total_amount##` script above, and give bump and upsell products their own script with their price and a unique transaction ID:

```text theme={null}
https://trk.yourdomain.com/cf/cv?payout=##product_price##&txid=##order_id##-##product_id##&ct=upsell
```

If the main product reports `##total_amount##`, the bump and upsell value is already in it. Pick one approach per funnel so revenue isn't counted twice.

**4. Using your own thank-you page**

If buyers go to an external thank-you page instead of SamCart's order summary, open your marketplace settings and turn on **Fire Pixels Before Redirect**. Otherwise the order scripts don't render.

> [!WARNING]
>
> The order script reads the click ID from a cookie. SamCart's order summary can live on a different subdomain from the checkout (`MARKETPLACENAME.samcart.com/order_summary`), and the script then can't see the cookie. Test with a real click before you rely on this route. If the conversion arrives without a campaign, use Route 1.

### SamCart short codes

| Short code | Use it for |
| - | - |
| `##total_amount##` | Order total, as `payout` on the main product |
| `##product_price##`, `##product_total##` | One product's value, for bumps and upsells |
| `##order_id##` | `txid` |
| `##product_id##` | Makes the `txid` unique per product |
| `##currency##` | `payout_currency`, if you sell in several currencies |

Short codes don't include URL parameters, so the click ID can't come from a short code.

***

## Verify the setup

**1. Click through the campaign**

Open the ClickFlare campaign URL. The SamCart checkout URL should show `click_id=` followed by a long ID.

**2. Place a test order**

Switch the product to **Test Mode** and buy. No money is charged, and SamCart fires webhooks and scripts as it would for a real buyer.

**3. Check SamCart**

Go to **Sell → Orders**, open the order and scroll to **Attribution**. **Show all parameters** should list your `click_id`. The **Events** section shows whether the webhook was delivered.

**4. Check ClickFlare**

The sale should appear on the campaign with its revenue. In **Logs → Event Logs**, check the `txid` and `ct`.

***

## Troubleshooting

> [accordion] The webhook never reaches Zapier or Make
>
> Open the order's **Events** section, or **Apps → Installed Apps → Webhooks** and its **Logs** (the last 1,000 events). Check that a rule exists for the trigger and, for a product-specific rule, for that product.

> [accordion] Conversions arrive without a campaign
>
> The click ID was missing or wrong. Check that the offer URL has `click_id={cf_click_id}` with braces, that the lander CTA uses the ClickFlare click URL, and that the Zap maps the click ID field from the attribution data, not a UTM field.

> [accordion] Each sale is counted twice
>
> Both routes are active, or the main product reports the order total while the upsell is reported again. Use one route, and one revenue approach.

> [accordion] Order scripts don't fire
>
> Save your changes, disable ad blockers while testing, and turn on **Fire Pixels Before Redirect** if you use an external thank-you page.

***

## FAQ

> [accordion] Does ClickFlare integrate with SamCart?
>
> Yes. SamCart saves the ClickFlare click ID from the checkout link with each order. A SamCart webhook through Zapier or Make, or an order script in each product, reports the sale to ClickFlare.

> [accordion] Can I use SamCart's Zapier app instead of the webhook?
>
> SamCart says its attribution data is also sent to Zapier, so a Zap triggered by SamCart's own app can work the same way. Check that the click ID is in the trigger sample before you build on it.

> [accordion] Are subscription renewals tracked?
>
> The setups above report the first order. SamCart has a **Subscription charged** trigger for recurring charges; you can send it as its own `ct` if it carries the attribution data. Test with one renewal first.

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

***

## Related

> [card] [Zapier](/docs/en/integrations/zapier-click-flare-integration-guide.md)
>
> Map webhooks to postbacks

> [card] [Postback parameters](/docs/en/tracking/click-flare-parameters-in-postback-urls.md)
>
> click\_id, txid, ct

> [card] [Custom conversions](/docs/en/settings/custom-conversions.md)
>
> Sale, upsell and refund columns


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