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

# ClickFunnels and ClickFlare Integration Guide

> Track ClickFunnels sales in ClickFlare: add the tracking script to the funnel Head Code and fire a conversion script on the thank-you page.

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

ClickFunnels is a funnel and sales page builder. Your opt-in pages, sales pages, order forms, one-click upsells and thank-you pages all run on ClickFunnels.

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

* **The ClickFlare script** goes in the funnel's **Head Code**, so every step records the visit and keeps the click ID in the browser.
* **A conversion script** in the thank-you page's code reports the sale to ClickFlare when the page loads.

> [!NOTE]
>
> Server-side reporting is usually more reliable than a page script, because ad blockers and cookie limits can't stop it. ClickFunnels has webhooks, but their order data has no documented field that carries your ClickFlare click ID, so this guide uses the thank-you page. See [About ClickFunnels webhooks](#about-clickfunnels-webhooks).

***

## At a glance

To set up ClickFunnels with ClickFlare:

1. Set up a tracking domain and conversions.
2. Create the campaign and funnel offer.
3. Add the script to the funnel.
4. Get the conversion script.
5. Add it to the thank-you page.

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

| | ClickFunnels + ClickFlare |
| - | - |
| **How it connects** | Direct tracking script + thank-you page script |
| **What reaches ClickFlare** | Funnel visits, sales and upsells |
| **Timing** | Real time, per conversion |
| **Key parameters** | `click_id={cf_click_id}`, `cpid={campaign_id}`, `payout`, `txid`, `ct` |
| **Works with** | Redirect and direct campaigns, incl. Google Ads |
| **Good to know** | Payout is fixed per thank-you page; no order variables. |

***

## 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 funnel                (direct campaign)
  → https://yourfunnel.com/offer?click_id=CF_CLICK_ID&cpid=CAMPAIGN_ID
     (the ClickFlare script in the funnel Head Code records the visit
      and keeps the click ID in the browser)
  → Sales page → order form → [one-click upsell]
  → Thank-you page
     (its Header or Footer Code runs the ClickFlare conversion script:
      https://trk.yourdomain.com/cf/cv?payout=47.00&txid=main&ct=sale
      and the script adds the click ID it finds in the browser)
  → ClickFlare matches the sale to the original click
```

| Piece | Where it lives in ClickFunnels | What it does |
| - | - | - |
| ClickFlare tracking script | Funnel settings → **Head Code** | Records the visit on every step of the funnel |
| Conversion script | Thank-you page → **Settings → Show Code** | Reports the sale when the page loads |
| `payout` | Typed into the script | The sale value for that funnel |
| `txid` | Typed into the script | Keeps reloads and steps apart |

***

## 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).
* A ClickFunnels workspace with access to funnel settings and the page editor.
* Your funnel on a domain you connected to ClickFunnels, so all steps share one domain.

***

## 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 both load from it, and the conversion script only finds the click ID when they use the same domain as the campaign. See [Tracking domains](/docs/en/settings/tracking-domains.md).

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

Go to **Settings → Custom Conversions** and click **Add**. Create **Sale** (`sale`) with **Include in Conversions** and **Include in Revenue**, and **Upsell** (`upsell`) with **Include in Revenue** if you track upsells. The parameter is the value you put in `ct`, and the two must match exactly. See [Custom conversions](/docs/en/settings/custom-conversions.md).

**3. Create the campaign**

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

* **Redirect** if the traffic source allows redirects. You can rotate landers and funnels.
* **Direct** for Google Ads and other sources that don't. The ad links straight to the funnel, and the script 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 funnel as an offer**

In the campaign path, create the offer inline with the URL of the first funnel step and the ClickFlare tokens:

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

For a direct campaign, turn on the **Direct Tracking** switch in the offer. Save the campaign and copy the tracking script and campaign URL from its **Tracking** tab.

> [!WARNING]
>
> Keep the braces: `{cf_click_id}`. Without them the funnel receives the literal text `cf_click_id`.

**5. Add the ClickFlare script to the funnel**

In ClickFunnels, open the funnel's settings and paste the script in **Head Code**. It then loads on every page in that funnel:

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

To cover every page on your ClickFunnels site instead, including other funnels, store pages and blogs, paste it in **Site & Blog → Site Settings → Header Code**. Use one place, not both. See [Direct tracking](/docs/en/tracking/direct-tracking-clickflare.md).

**6. Get the conversion script**

In ClickFlare, go to **Settings → Tracking URLs** and copy the JavaScript conversion script. It reads the click ID from the visitor's browser. Remove the `click_id=OPTIONAL` placeholder and set the payout and transaction ID:

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

Use the price of the funnel's main product as the payout. See [Conversion tracking pixel](/docs/en/settings/conversion-tracking-pixel.md).

**7. Add it to the thank-you page**

Open the thank-you page in the page editor. Go to **Settings → Show Code** (in a funnel page, **Settings** is under the **Customize** gear icon) and paste the script in the **Footer Code** tab. Footer Code runs after the page has loaded, which suits a conversion. Save.

Code added in the page editor applies to that page only, which is what you want here: the conversion should fire on the thank-you page and nowhere else.

***

## Payout and transaction ID

ClickFunnels' help center doesn't document variables that put the order ID or order total into page code. That shapes the conversion script:

* **Payout is fixed per page.** Type the value of what the buyer bought on the way to that page. If one funnel sells several price points, give each its own thank-you page, or set the offer's payout in ClickFlare instead.
* **Use a fixed `txid` per step.** ClickFlare keeps one conversion per click ID and transaction ID. A fixed value like `main` means a buyer who reloads the thank-you page doesn't count twice, while a different value on another step (`upsell1`) counts as its own conversion on the same click.

If you have ClickFunnels order data available on the page through your own code, use the real order ID as `txid` and the real total as `payout` instead.

***

## Upsells and order bumps

ClickFunnels' one-click upsell (OTO) pages come after the order form. A page script only knows that the page loaded, not what the buyer accepted, so:

* **Order bumps** are part of the main order. The fixed payout can't tell whether the bump was taken. Report the main product's price, or add the bump's value if most buyers take it.
* **Upsells** can be tracked when the page after an accepted upsell is different from the page after a declined one. Add the conversion script to the accepted page with its own `txid` and `ct=upsell`:

```text theme={null}
https://trk.yourdomain.com/cf/cv?payout=97.00&txid=upsell1&ct=upsell
```

If accepted and declined buyers land on the same page, a page script can't separate them. Test your funnel's routing before relying on upsell numbers.

***

## About ClickFunnels webhooks

ClickFunnels can send webhooks on the Scale, Optimize and Dominate plans, from **Workspace Settings → Webhooks → Add New Endpoint**. Events include `order.completed`, `one-time-order.completed` and `one_time_order.refunded`. Webhooks are sent as a fixed JSON body you can't rewrite, so they would need Zapier, Make or a small script between ClickFunnels and ClickFlare.

The blocker is the click ID. ClickFunnels doesn't document URL parameters in the order or contact payload. To check your own account:

1. Create a webhook endpoint pointing to a test URL from a service like webhook.site.
2. Click through your ClickFlare campaign and place a test order.
3. Look for your `click_id` value in the delivered JSON. You can also see deliveries in **Workspace Settings → Webhooks**, under **Deliveries**.

If the click ID is there, you can route the webhook through [Zapier](/docs/en/integrations/zapier-click-flare-integration-guide.md) or [Make](/docs/en/integrations/make-click-flare-integration-guide.md) and send the postback server-side, including refunds with `ct=refund` and a negative payout. If it isn't, stay with the thank-you page script.

***

## Verify the setup

**1. Click through the campaign**

Open the ClickFlare campaign URL in a private window. The funnel URL should show `click_id=` followed by a long ID.

**2. Check the scripts load**

In your browser's network tab, look for the request to `/cf/scripts/` on your tracking domain on the first funnel step.

**3. Place a test order**

Use ClickFunnels' test mode for the checkout. On the thank-you page, look for the request to `/cf/cv`.

**4. Check ClickFlare**

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

***

## Troubleshooting

> [accordion] The page won't save after I paste code
>
> ClickFunnels won't save Header or Footer Code that contains template syntax it can't render, such as an unclosed `{{` or `{%`. The ClickFlare scripts don't contain either. If you added your own code, wrap that part in `{% raw %}` and `{% endraw %}`, or remove it.

> [accordion] No conversions arrive
>
> * Check that the conversion script is on the thank-you page itself, not in the funnel Head Code. Funnel-wide code would fire on every step.
> * Check that the visitor came through the ClickFlare campaign URL.
> * Turn off ad blockers while testing.

> [accordion] Conversions arrive without a campaign
>
> The conversion script found no click ID. Check that the tracking script loads on the first funnel step, that both scripts use the same tracking domain as the campaign, and that every funnel step is on the same domain.

> [accordion] The sale is counted on every reload
>
> The script has no `txid`. Add a fixed one such as `txid=main`.

***

## FAQ

> [accordion] Does ClickFlare integrate with ClickFunnels?
>
> Yes, through direct tracking. The ClickFlare script in the funnel's Head Code records the visit, and a conversion script on the thank-you page reports the sale.

> [accordion] Header Code or Footer Code?
>
> ClickFunnels suggests Header Code for scripts that must load early, like analytics, and Footer Code for scripts that need the page loaded first. Use the funnel's **Head Code** for the tracking script and the thank-you page's **Footer Code** for the conversion.

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

> [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] [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] [Funnelish](/docs/en/integrations/track-funnelish-campaigns-through-click-flare.md)
>
> Another funnel builder


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