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

# CPAlead and ClickFlare Integration Guide

> Track CPAlead offers in ClickFlare: pass the click ID in subid on direct links, and save the ClickFlare postback in CPAlead's Postback Configuration.

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

CPAlead is a CPA network for publishers. You can promote its offers through direct offer links, an offerwall or content lockers. Its postback is built for publishers: when a qualifying conversion happens, CPAlead sends an HTTP GET request to a URL you choose, with the values you asked for. To CPAlead, ClickFlare is simply that URL.

To track CPAlead offers in ClickFlare, two links have to carry the ClickFlare click ID in both directions:

* **The offer URL** sends the ClickFlare click ID to CPAlead in `subid` on your direct offer link.
* **The postback URL** sends it back to ClickFlare with every conversion, together with the payout and CPAlead's unique lead ID. You save it once in CPAlead's **Postback Configuration**.

This guide covers the setup for direct links, how event offers come through, CPAlead's delivery rules, and how to check that it all works.

> [!TIP]
>
> Only need the two values? The [Click ID & postback macros](/docs/en/integrations/click-id-and-postback-macros.md?q=cpalead) page has them ready to copy with your tracking domain.

***

## At a glance

To set up CPAlead with ClickFlare:

1. Set up your domain and postback time.
2. Create the CPAlead affiliate network.
3. Save the postback in CPAlead.
4. Copy the offer's direct link.
5. Create the offer and launch.

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

| | CPAlead + ClickFlare |
| - | - |
| **How it connects** | CPAlead template + Postback Configuration |
| **What reaches ClickFlare** | Conversions and paid events with payout and lead ID |
| **Timing** | Real time, per conversion |
| **Key parameters** | `subid={cf_click_id}`, `{subid}`, `{payout}`, `{lead_id}`, `{event_key}` |
| **Works with** | Direct offer links |
| **Good to know** | CPC earnings and reversals never send a postback. |

***

## 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://cpalead-tracking-domain/view.php?id=1234&pub=5678&subid=CF_CLICK_ID
     (CPAlead stores the ClickFlare click ID in subid)
  → Visitor completes the offer
  → CPAlead sends your postback (HTTP GET):
     https://trk.yourdomain.com/cf/cv?click_id=CF_CLICK_ID&payout=0.85&txid=CPALEAD_LEAD_ID
     (ClickFlare matches the conversion to the original click)
```

The two links mirror each other:

| Link | Built from | CPAlead side | ClickFlare side |
| - | - | - | - |
| **Offer URL** (in ClickFlare) | CPAlead's parameter + ClickFlare's token | `subid` | `{cf_click_id}` |
| **Postback URL** (in CPAlead) | ClickFlare's parameter + CPAlead's macros | `{subid}`, `{payout}`, `{lead_id}` | `click_id`, `payout`, `txid` |

> [!NOTE]
>
> **Offer URL = their parameter + your token. Postback URL = your parameter + their token.** CPAlead writes the click ID into `subid` on the way in and reads it back with the `{subid}` macro on the way out. The names to the left of `=` are ClickFlare's; the macros in braces are CPAlead's.

***

## What you'll need

* An active ClickFlare account with your **own tracking domain** set up, on **HTTPS**. Shared domains get flagged by networks and blocked by browsers. See [Tracking domains](/docs/en/settings/tracking-domains.md).
* A CPAlead publisher account.
* Direct offer links. The offerwall and lockers pass your own user IDs in `subid` to reward users, which is a different flow. See [Offerwall and lockers](#offerwall-and-lockers).

***

## What the CPAlead template contains

ClickFlare has a **CPAlead** affiliate network template. It fills in the CPAlead macros ClickFlare needs.

![The CPAlead template in ClickFlare: Click Id is \{subid}, Payout is \{payout} and Transaction ID is \{lead\_id}](https://mintcdn.com/clickflare/b2lpDlx8sR69TsUK/images/integrations/cpalead/clickflare-cpalead-template-parameters.png?fit=max\&auto=format\&n=b2lpDlx8sR69TsUK\&q=85\&s=fa6dea89885f17e74b56bb2b21d25f21)

| Field | CPAlead macro (AN Token) | ClickFlare parameter | What it does |
| - | - | - | - |
| **Click Id** | `{subid}` | `click_id` | Returns the ClickFlare click ID that the offer URL put in `subid`. |
| **Payout** | `{payout}` | `payout` | CPAlead's payout for the conversion. On an event offer, the payout for that event. |
| **Transaction ID** | `{lead_id}` | `txid` | CPAlead's unique ID for each conversion and each paid event. See [Transaction ID](#transaction-id). |
| **Event Type** | leave empty | `ct` | The conversion type. Leave it empty, or see [Event offers](#event-offers). |

The offer parameter is `subid`. CPAlead only accepts the macros it supports, in lowercase, and rejects anything else when you save or test the postback.

***

## Setup

Everything in ClickFlare is done from inside the campaign editor. Create the offer and the affiliate network inline as you go.

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

Add a custom tracking domain before anything else, for example `trk.yourdomain.com`, with SSL. CPAlead expects an HTTPS postback URL that answers directly, without redirects. The postback URL is built on this domain, so changing it later means updating it in CPAlead too. See [Tracking domains](/docs/en/settings/tracking-domains.md).

**2. Report conversions by postback time**

Go to **Settings → General Settings** and set **Conversion registration time reporting** to **Postback Timestamp**.

CPAlead reports a conversion on the day it happened. With the default **Visit Timestamp**, ClickFlare reports it on the day of the original click, so a conversion or event that comes in days later lands on a different date in each platform. See [Conversion registration time](/docs/en/settings/conversion-registration-time-reporting.md).

> [!NOTE]
>
> This is an account-wide setting. It changes the date conversions are reported on for every campaign.

**3. Create the campaign**

Go to **Campaigns → New Campaign**, choose **Redirect tracking**, pick your traffic source and select your tracking domain. See [Creating a campaign](/docs/en/campaigns/creating-a-campaign-in-click-flare.md).

**4. Create the CPAlead affiliate network**

While creating the offer for the campaign, create a new affiliate network in its **Affiliate Network** field. You can also create it first under **Affiliate Networks → + New**. Either way:

1. Search for **CPAlead** and pick the template.
2. Name it, for example "CPAlead".
3. Check the fields: **Click Id** `{subid}`, **Payout** `{payout}`, **Transaction ID** `{lead_id}`.
4. Leave **Event Type** empty.
5. Under **Conversion tracking**, select your own **Tracking Domain** and keep **S2S Postback URL** as the tracking method.
6. Set **Payout currency** to the currency of your CPAlead account.

ClickFlare builds the postback URL from these fields:

```text theme={null}
https://trk.yourdomain.com/cf/cv?click_id={subid}&payout={payout}&txid={lead_id}
```

![The Conversion tracking section of the CPAlead network in ClickFlare, with the generated postback URL: click\_id=\{subid}\&payout=\{payout}\&txid=\{lead\_id}](https://mintcdn.com/clickflare/b2lpDlx8sR69TsUK/images/integrations/cpalead/clickflare-cpalead-postback-url.png?fit=max\&auto=format\&n=b2lpDlx8sR69TsUK\&q=85\&s=31a5c26a5c4fd02a8f29b36d5ff2a68c)

Copy the postback URL and save the network.

**5. Save the postback in CPAlead**

In CPAlead, open **Postback Configuration**. Then:

1. Paste the ClickFlare postback URL into the URL field.
2. Leave **Postback Password** empty. ClickFlare doesn't check it, and adding `{password}` to the URL would only send your secret along with every conversion.
3. Turn on **Postback Enabled**.
4. Click **Save**. Turning on the switch alone doesn't save it.

CPAlead's docs describe one postback URL in **Postback Configuration**, not one per offer, so it covers every conversion on your publisher account.

**6. Get the offer's direct link from CPAlead**

Copy the tracking link for the offer from your CPAlead account. A direct link looks like this:

```text theme={null}
https://cpalead-tracking-domain/view.php?id=1234&pub=5678
```

`id` is the offer and `pub` is your publisher ID. Keep the tracking domain, offer ID and publisher ID as CPAlead gives them.

**7. Create the offer in ClickFlare**

In the offer form:

1. Name the offer.
2. Select the CPAlead affiliate network you just created.
3. Paste the CPAlead link into **Offer URL** with `&subid={cf_click_id}` at the end:

```text theme={null}
https://cpalead-tracking-domain/view.php?id=1234&pub=5678&subid={cf_click_id}
```

![The Offer URL field of the ClickFlare New Offer form with a CPAlead link ending in subid=\{cf\_click\_id}](https://mintcdn.com/clickflare/b2lpDlx8sR69TsUK/images/integrations/cpalead/clickflare-cpalead-offer-url.png?fit=max\&auto=format\&n=b2lpDlx8sR69TsUK\&q=85\&s=6c239dd226b617c356973d84f268212a)

If you pasted the link without `subid`, you can turn on **Append Click ID to Offer Url** instead. ClickFlare then adds `subid={cf_click_id}` from the template. Use one or the other, not both.

> [!WARNING]
>
> Write `{cf_click_id}` with braces. Without them CPAlead stores the literal text `cf_click_id`, the postback returns that text, and the conversion cannot be matched to a click.

Set the payout to **Auto** so ClickFlare uses the `payout` value from the postback.

**8. Add a lander (optional)**

If you send traffic through a lander before the offer, the lander's CTA must use the **ClickFlare click URL**, not the CPAlead link. ClickFlare then adds the click ID when it redirects to the offer. See [Paths with landers and offers](/docs/en/campaigns/campaign-s-path-destination-to-landers-offers.md).

**9. Save the campaign and launch**

Save the campaign, copy the campaign URL from the **Tracking** tab and use it in your ads. Before you spend money on traffic, run the checks in [Verify the setup](#verify-the-setup).

***

## Transaction ID

By default ClickFlare keeps **one conversion per click ID**. If several postbacks arrive with the same click ID and no transaction ID, ClickFlare treats them as the same conversion, and you only see one of them (the last one received). When they carry a `txid`, the **same** `txid` replaces the earlier conversion and a **different** `txid` adds a new one.

CPAlead's `{lead_id}` is exactly what ClickFlare needs:

* Every conversion and every paid event gets its own `{lead_id}`, so each one counts in ClickFlare.
* CPAlead can deliver the same postback more than once when it retries after an error. A retry carries the same `{lead_id}`, so it replaces the first one instead of counting twice.

CPAlead also accepts `{transaction_id}` as another name for `{lead_id}`. Either works. Don't use `{subid}` or `{campaign_id}` as the transaction ID: they are the same for every event on the click.

***

## Event offers

Some CPAlead offers pay on several events for the same user, for example an install and then a level reached in an app. Each paid event arrives as its own postback, with its own `{lead_id}` and the event's payout in `{payout}`. With `txid={lead_id}`, ClickFlare records each event as a separate conversion on the click. Events can arrive in any order.

To see events as their own conversion types, use CPAlead's `{event_key}` macro as `ct`. It holds a key such as `event_1`, and is empty for ordinary conversions:

1. Create a [custom conversion](/docs/en/settings/custom-conversions.md) in ClickFlare for each event you want as a column, with the parameter `event_1`, `event_2` and so on.
2. Add `&ct={event_key}` to the end of the postback URL in CPAlead:

```text theme={null}
https://trk.yourdomain.com/cf/cv?click_id={subid}&payout={payout}&txid={lead_id}&ct={event_key}
```

> [!WARNING]
>
> The `ct` value must **exactly match** a parameter of a custom conversion in ClickFlare. If it doesn't, ClickFlare records a regular conversion instead. That also covers ordinary conversions, where `{event_key}` is empty. Event keys can differ between offers, so check them in the postback logs before you create the custom conversions.

To keep the event name for reporting without changing how it counts, add `&param1={event_name}` instead. See [Postback parameters](/docs/en/tracking/click-flare-parameters-in-postback-urls.md).

***

## Delivery rules

CPAlead is strict about the receiving URL. Your ClickFlare tracking domain meets these rules once it's set up with SSL:

* **HTTPS**, and the final URL: CPAlead doesn't follow redirects.
* A fast **HTTP 2xx** response, well within 15 seconds.
* Reachable without a login, cookies or JavaScript. If anything in front of your tracking domain filters traffic, allow CPAlead's postback relay IP, shown in the postback section of your account.

If deliveries keep failing, CPAlead shows a postback error warning and can pause delivery. Fix the cause first, then save the configuration again.

Two things never produce a postback: **CPC earnings**, and **reversals**. If CPAlead reverses a conversion later, ClickFlare isn't told. Compare ClickFlare with your CPAlead stats before payday.

***

## Offerwall and lockers

On the offerwall and content lockers, `subid` is meant for your own **user ID**, so CPAlead knows which of your users to reward. There's no ClickFlare click in that flow, so ClickFlare can't match those conversions. And if your account has a single postback URL, as CPAlead's docs describe, the same URL receives offerwall conversions too: they reach ClickFlare with a user ID as `click_id` and don't match any click.

If you already use the postback to reward users on your own site, don't replace it with ClickFlare's URL. Ask CPAlead support whether your account can send a second postback, or keep ClickFlare tracking on a separate publisher account.

***

## Verify the setup

**1. Click through the campaign**

Open the ClickFlare campaign URL (with a lander, also click the CTA). When the offer loads, the first request goes to CPAlead's tracking domain. In your browser's network tab, check that it has `subid=` followed by a real ClickFlare click ID, not the literal text `{cf_click_id}`. Copy that click ID.

**2. Send a test from CPAlead**

Open CPAlead's **Testing** page. Replace the sample `subid` with the click ID you copied, set a small payout and a test lead ID, and send it. The tester sends a real request: check that the resolved URL is your ClickFlare postback and that the response is 2xx. Tester values aren't saved to your configuration.

**3. Check the conversion in ClickFlare**

The test conversion should appear on the campaign with the payout you set, and with a `txid`. After real conversions, check CPAlead's **Postback Logs** for delivery results.

***

## Troubleshooting

> [accordion] Conversions show in CPAlead but not in ClickFlare
>
> Work through these in order:
>
> * **The postback isn't saved.** Turn on **Postback Enabled** and click **Save** in **Postback Configuration**.
> * **CPAlead rejects a macro.** Every macro must be on CPAlead's supported list, in lowercase. `{click_id}` and `{status}` are not CPAlead macros.
> * **Delivery fails.** Check **Postback Logs** for the HTTP status. A redirect, a 4xx or a timeout means the URL isn't your final HTTPS tracking domain.
> * **subid is empty in CPAlead.** The offer URL is missing `subid={cf_click_id}`, or the lander CTA links straight to CPAlead instead of using the ClickFlare click URL.
> * **The earnings are CPC.** CPC earnings don't send postbacks.
>
> See [Troubleshooting S2S postbacks](/docs/en/tracking/troubleshooting-s2s-postback-url-in-clickflare.md) for the general checks.

> [accordion] ClickFlare receives a user ID or cf\_click\_id
>
> * A user ID means the conversion came from your offerwall or a locker. See [Offerwall and lockers](#offerwall-and-lockers).
> * A literal `cf_click_id` means the offer URL in ClickFlare has the token without braces. It must be `{cf_click_id}`.

> [accordion] Only one event per click shows in ClickFlare
>
> The postback has no `txid`. Add `txid={lead_id}` in the ClickFlare network and save the updated URL in CPAlead.

> [accordion] The payout is 0 or in the wrong currency
>
> * Check that the postback has `payout={payout}` and the offer's payout is set to **Auto** in ClickFlare. Don't use `{virtual_currency}`: it's usually 0.
> * Set the affiliate network's **Payout currency** in ClickFlare to the currency of your CPAlead account.

***

## FAQ

> [accordion] Does ClickFlare integrate with CPAlead?
>
> Yes. ClickFlare has a CPAlead affiliate network template. You pass the click ID in subid on the direct link and save the ClickFlare URL in CPAlead's Postback Configuration.

> [accordion] Can I pass more data to CPAlead?
>
> Yes. Direct links also take `subid2` and `subid3`, and CPAlead returns them with `{subid2}` and `{subid3}`. Use them for your own labels, such as the traffic source or placement, and keep `subid` for the click ID. For mobile traffic you can also pass `idfa` and `gaid`.

> [accordion] Can I see which offer converted?
>
> Add `&param1={campaign_id}` or `&param1={campaign_name}` to the postback in CPAlead. ClickFlare stores it as an extra parameter you can report on.

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

***

## Related

> [card] [Macro reference](/docs/en/integrations/click-id-and-postback-macros.md)
>
> Every network's values

> [card] [Custom conversions](/docs/en/settings/custom-conversions.md)
>
> Events as columns

> [card] [Postback issues](/docs/en/tracking/troubleshooting-s2s-postback-url-in-clickflare.md)
>
> Troubleshoot S2S


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