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

# CAKE and ClickFlare Integration Guide

> Track CAKE offers in ClickFlare: pass the click ID in s2, add the postback on the offer's Testing & Tracking tab, and use #leadid# as the transaction ID.

![CAKE and ClickFlare Integration](https://mintcdn.com/clickflare/zLfe2OONp5IP-L89/images/integrations/covers/cake.png?fit=max\&auto=format\&n=zLfe2OONp5IP-L89\&q=85\&s=39ca646f9e3ea741f822fb7065f3ecff)

CAKE is the software behind many CPA affiliate networks. As an affiliate, you log in to the network's own CAKE portal, usually on the network's domain, pick offers, get tracking links and place your postback. Networks running on CAKE include ClickDealer, Advidi, Adeer, Gotzha and Yepads, and many more that don't say so on their site.

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

* **The offer URL** sends the ClickFlare click ID to CAKE in `s2`.
* **The postback URL** sends it back to ClickFlare with every conversion, together with the payout and a unique conversion ID.

This guide covers the full setup, why the transaction ID should be `#leadid#` rather than `#tid#`, what happens with events and pending conversions, 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=cake) page has them ready to copy with your tracking domain.

***

## 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://network-domain.com/?a=12345&c=678&s2=CF_CLICK_ID
     (CAKE stores the ClickFlare click ID in s2)
  → Visitor converts on the advertiser's page
  → CAKE fires your postback:
     https://trk.yourdomain.com/cf/cv?click_id=CF_CLICK_ID&payout=25.00&txid=CAKE_LEAD_ID
     (ClickFlare matches the conversion to the original click)
```

The two links mirror each other:

| Link | Built from | CAKE side | ClickFlare side |
| - | - | - | - |
| **Offer URL** (in ClickFlare) | CAKE's parameter + ClickFlare's token | `s2` | `{cf_click_id}` |
| **Postback URL** (in CAKE) | ClickFlare's parameter + CAKE's token | `#s2#`, `#price#`, `#leadid#` | `click_id`, `payout`, `txid` |

> [!NOTE]
>
> **Offer URL = their parameter + your token. Postback URL = your parameter + their token.** CAKE writes the click ID into `s2` on the way in and reads it back with the `#s2#` token on the way out. CAKE tokens are wrapped in `#`, not braces.

***

## What you'll need

* An active ClickFlare account with your **own tracking domain** set up. Shared domains get flagged by networks and blocked by browsers. See [Tracking domains](/docs/en/settings/tracking-domains.md).
* An affiliate account on the network's CAKE portal, approved for the offer you want to run. CAKE only shows the tracking tab for offers you're approved on.
* If the network reviews affiliate pixels: a few hours for them to approve your postback. CAKE's default is that affiliate pixels wait for approval.

***

## What the CAKE template contains

ClickFlare has a **Cake (getCAKE.com)** affiliate network template. It fills in the CAKE tokens ClickFlare needs.

![The Cake (getCAKE.com) template in ClickFlare: Click Id is #s2#, Payout is #price# and Transaction ID is #leadid#](https://mintcdn.com/clickflare/zLfe2OONp5IP-L89/images/integrations/cake/clickflare-cake-template-parameters.png?fit=max\&auto=format\&n=zLfe2OONp5IP-L89\&q=85\&s=dd8983c597e9f12dd30be30bbfab5910)

| Field | CAKE token (AN Token) | ClickFlare parameter | What it does |
| - | - | - | - |
| **Click Id** | `#s2#` | `click_id` | Returns the ClickFlare click ID that the offer URL put in `s2`. Pre-filled by the template. |
| **Payout** | `#price#` | `payout` | Your payout for the conversion, as a plain number. Pre-filled by the template. |
| **Transaction ID** | `#leadid#` (change it) | `txid` | CAKE's unique ID for each conversion. The template fills in `#tid#`: replace it with `#leadid#`. See [why](#why-the-transaction-id-matters). |
| **Event Type** | leave empty | `ct` | The conversion type. CAKE doesn't send an event name, so leave it empty. See [Events](#events-and-multi-step-offers). |

> [!WARNING]
>
> Use `#leadid#`, not `#tid#`, as the transaction ID. `#tid#` is the **advertiser's** order ID, and many advertisers never send one, so it often arrives empty. `#leadid#` is the ID CAKE itself gives every conversion.

***

## 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`. The postback URL is built on this domain, so changing it later means updating the postback in every CAKE offer 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**.

CAKE 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 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 CAKE 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 **Cake** and pick the **Cake (getCAKE.com)** template.
2. Name it after the network, for example "CAKE - ClickDealer". Each CAKE network has its own portal and its own postbacks, so create one affiliate network per CAKE network.
3. Change **Transaction ID** from `#tid#` to `#leadid#`.
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 the network pays you in.

ClickFlare builds the postback URL from these fields:

```text theme={null}
https://trk.yourdomain.com/cf/cv?click_id=#s2#&payout=#price#&txid=#leadid#
```

![The Conversion tracking section of the CAKE network in ClickFlare, with the generated postback URL: click\_id=#s2#, payout=#price# and txid=#leadid#](https://mintcdn.com/clickflare/zLfe2OONp5IP-L89/images/integrations/cake/clickflare-cake-postback-url.png?fit=max\&auto=format\&n=zLfe2OONp5IP-L89\&q=85\&s=3e043b42cae0b09de6178f27b646a157)

Copy the postback URL and save the network.

**5. Get the offer's tracking link from CAKE**

In the CAKE portal, go to **Offers**, click the offer's name and open the **Creatives** tab. Click **Get Link** next to the creative you want. The link looks like this:

```text theme={null}
https://network-domain.com/?a=12345&c=678
```

`a` is your affiliate ID and `c` identifies the creative and the campaign. Some portals let you fill in sub IDs before copying. If yours does, type `{cf_click_id}` in **s2**. If not, you'll add it in ClickFlare in the next step.

> [!NOTE]
>
> Use `s2`, not `s1`. CAKE reserves `s1` for values that repeat, such as a sub-affiliate or placement ID, and limits it to 50 characters. A different value on every click in `s1` triggers CAKE's "Excessive Unique Sub ID" alert. `s2` to `s5` take up to 100 characters each.

**6. Create the offer in ClickFlare**

In the offer form:

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

```text theme={null}
https://network-domain.com/?a=12345&c=678&s2={cf_click_id}
```

![The ClickFlare New Offer form with the CAKE affiliate network selected and s2=\{cf\_click\_id} at the end of the Offer URL](https://mintcdn.com/clickflare/zLfe2OONp5IP-L89/images/integrations/cake/clickflare-cake-offer-url.png?fit=max\&auto=format\&n=zLfe2OONp5IP-L89\&q=85\&s=5411e66b77dfb019b0105d3b9c6c676f)

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

> [!WARNING]
>
> Write `{cf_click_id}` with braces. Without them CAKE 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.

**7. Add the postback in CAKE**

Back in the CAKE portal, open the same offer and go to its **Testing & Tracking** tab. You'll see these fields:

| Field | What to do |
| - | - |
| **Postback URL** | Paste the ClickFlare postback URL you copied |
| **Postback Delay (ms)** | Leave empty. It only delays the postback so a browser pixel can fire first. |
| **Pixel HTML** | Leave empty. It's for iframe, image or JavaScript pixels, not for a postback URL. |

Click **Save**. The **Tokens** section on the same tab lists every token this network supports, so you can check `#s2#`, `#price#` and `#leadid#` are there.

> [!NOTE]
>
> The postback is set **per offer**. CAKE's account-wide ("global") affiliate pixel can only be placed by the network, so if you want one postback for all your offers, send the URL to your affiliate manager. If an offer has both, CAKE fires only the offer's postback.

If the network reviews pixels, the postback waits for their approval and doesn't fire until then. Ask your affiliate manager to approve it.

**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 CAKE 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).

***

## Why the transaction ID matters

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). The `txid` parameter tells ClickFlare that each postback is a separate conversion, so its value has to be **different on every conversion**.

| CAKE token | Value | Use it as txid? |
| - | - | - |
| `#leadid#` | The conversion or lead ID CAKE gives every conversion and event | **Yes** |
| `#tid#` | The advertiser's own transaction ID, sent in `t=` on their pixel. Optional for advertisers. | No: often empty |
| `#cid#` | The creative ID | No: the same for every conversion |
| `#oid#`, `#campid#` | The offer and campaign IDs | No: the same for every conversion |

With `#leadid#`, a sale that follows a lead on the same click, or a second purchase, arrives with its own transaction ID and counts as its own conversion. If CAKE resends the same conversion, it carries the same `#leadid#` and ClickFlare doesn't count it twice.

***

## Events and multi-step offers

Some CAKE offers pay on more than one step, for example a lead and then a sale. CAKE calls these **events**. What that means for you:

* **One postback covers all published events.** CAKE fires your offer's postback for the conversion and again for every event the network has published to affiliates. Unpublished events don't fire your postback and pay you nothing.
* **There is no per-event postback field** in the affiliate portal, and CAKE sends **no event name**. Every event arrives in ClickFlare as the same conversion type.
* **`#leadid#` keeps them apart.** Each event gets its own ID, so ClickFlare counts each one. The payout tells them apart in your reports: each event pays its own `#price#`.

> **Can I report CAKE events as separate custom conversions?**
>
> Only if your network fills in the `#eid#` (event ID) token in affiliate postbacks. That isn't documented for the affiliate portal, so check the **Tokens** list on the offer, or ask your affiliate manager. If it works, you can map event IDs to [custom conversions](/docs/en/settings/custom-conversions.md) with the `ct` parameter. Otherwise, keep one conversion type and use the payout to tell the steps apart.

***

## Pending and rejected conversions

CAKE fires your postback when it records the conversion. If the network reviews conversions before paying, that includes conversions still waiting for review.

* CAKE has **no status token** for affiliates, and it doesn't send a second postback when a conversion is approved, rejected or scrubbed later.
* ClickFlare therefore counts what CAKE recorded, not what the network finally paid. Compare against the network's conversion report before payday, and adjust in ClickFlare if the network scrubbed conversions.

***

## 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 the network's CAKE domain. In the address bar or your browser's network tab, check that it has `s2=` followed by a real ClickFlare click ID, not the literal text `{cf_click_id}`.

**2. Generate a test conversion**

Ask your affiliate manager to fire a test conversion on your click, or complete the offer if that's allowed. Don't rely on CAKE's **Test Mode** alone: it can suppress affiliate pixels, and a test fired from the network's own tool without a real ClickFlare click has no click ID to match.

**3. Check the conversion in ClickFlare**

The conversion should appear on the campaign with the payout from CAKE. In **Logs → Event Logs**, check that it arrived with a `txid` (CAKE's lead ID). A conversion fired in Test Mode may arrive with a payout of 0.

***

## Troubleshooting

> **Conversions show in CAKE but not in ClickFlare**
>
> Work through these in order:
>
> * **The postback is waiting for approval.** Ask your affiliate manager whether your pixel on that offer is approved.
> * **The postback is on another offer.** CAKE postbacks are per offer. Check the **Testing & Tracking** tab of the offer you're running.
> * **The postback is in Pixel HTML.** A URL in the Pixel HTML field is loaded as a browser pixel, if at all. It must be in **Postback URL**.
> * **s2 is empty in CAKE.** The offer URL is missing `s2={cf_click_id}`, or the lander CTA links straight to CAKE instead of using the ClickFlare click URL.
> * **The click ID went into another sub ID.** If the offer URL uses `s1` or `s3` but the postback reads `#s2#`, ClickFlare receives the wrong value. Both sides must use the same sub ID.
> * **The postback uses http on an SSL offer.** If the offer has SSL turned on, CAKE requires an `https://` postback.
>
> See [Troubleshooting S2S postbacks](/docs/en/tracking/troubleshooting-s2s-postback-url-in-clickflare.md) for the general checks.

> **Only one of several conversions shows in ClickFlare**
>
> The postback has no `txid`, or uses `#tid#` and the advertiser doesn't send one. Change the transaction ID to `#leadid#` in the ClickFlare affiliate network and in the postback on each CAKE offer. Conversions that were already merged are not restored.

> **ClickFlare receives a literal #s2# or cf\_click\_id**
>
> * A literal `#s2#` means CAKE didn't replace the token. Check the spelling against the **Tokens** list on the offer.
> * A literal `cf_click_id` means the offer URL in ClickFlare has the token without braces. It must be `{cf_click_id}`.

> **The payout is 0 or in the wrong currency**
>
> * Check that the postback has `payout=#price#` and the offer's payout is set to **Auto** in ClickFlare.
> * Test Mode conversions pay 0.
> * `#price#` has no currency. Set the affiliate network's **Payout currency** in ClickFlare to the currency the network pays you in.

***

## FAQ

> **Why s2 and not s1?**
>
> CAKE reserves `s1` for recurring values and limits it to 50 characters, and every major tracker uses `s2` for its click ID. Any of `s2` to `s5` works as long as the offer URL and the postback use the same one.

> **My network's portal doesn't look like this**
>
> Many networks customise their CAKE portal or run their own interface on top of CAKE. ClickDealer, for example, has a **Tools → Global postback** page. The tokens stay the same: if the portal lists `#s2#`, `#price#` and `#leadid#`, this guide applies.

> **Can I pass more data to CAKE?**
>
> Yes. Use the other sub IDs in the offer URL, for example `s3={campaign_id}&s4={trackingField1}`. CAKE shows them in its reports. Keep `s2` for the click ID.

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

***

## Related

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

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

> **[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.