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

# Kayzen as a Traffic Source

> Track Kayzen programmatic campaigns in ClickFlare and send conversions back to Kayzen's Event API with the bid ID.

![Kayzen traffic source template](https://mintcdn.com/clickflare/0jaeWC_DJvLt2SMH/images/integrations/covers/templates/kayzen.png?fit=max\&auto=format\&n=0jaeWC_DJvLt2SMH\&q=85\&s=aa8d5435c8f5edc115745820a8aae29b)

Kayzen is a self-serve programmatic platform (a DSP) for mobile marketing teams. It buys in-app inventory on ad exchanges in real time, with image, native, video and HTML creatives. This guide sets up Kayzen as a traffic source in ClickFlare. It covers passing Kayzen's click data into your reports and sending conversions back to Kayzen through its Event API, so its optimization and your stats agree.

You do everything from the **campaign editor**. The Kayzen traffic source is created inline, without leaving the campaign.

The Kayzen template needs some work before launch. Its postback has two placeholders to replace and sends no revenue. This guide goes through each one.

## At a glance

| | |
| - | - |
| **Ad formats** | In-app image, native, video and HTML ads, bought programmatically across ad exchanges |
| **Click ID macro** | `{CONVERSION_ID}`, mandatory for conversion tracking |
| **Conversion tracking** | S2S postback to Kayzen's Event API on `api-events.kayzen.io`, authenticated with your app's or website's API key |
| **Payout passed back** | No, not in the template. You can add it with `revenue_USD`. |
| **Multiple events** | Yes, one postback per `app_event` name |
| **Cost** | Not passed. The template's Cost row is empty. Cost Model: **CPC**. |
| **Conversion API** | No ClickFlare integration. The postback itself is Kayzen's Event API. |

## How it works

**1. Kayzen sends the click**

A user clicks your ad inside a publisher's app. Kayzen records the click, then opens your ClickFlare campaign URL and fills in its macros: the bid ID in `bid_id`, plus the campaign, creative, exchange, publisher app, operating system, device and carrier.

**2. ClickFlare stores the Kayzen bid ID**

ClickFlare saves the value of `bid_id` as the visit's **External ID** and redirects the user to your lander or offer.

**3. The conversion reaches ClickFlare**

Your affiliate network or store posts the conversion back to ClickFlare, matched on the ClickFlare click ID.

**4. ClickFlare posts it back to Kayzen**

ClickFlare fires the Kayzen postback, replacing `{external_id}` with the stored bid ID. Kayzen's Event API records the event against your app or website and matches it to the original click.

> [!NOTE]
>
> The mirror to keep straight: in the **campaign URL** you write *ClickFlare's* parameter (`bid_id`) and *Kayzen's* macro (`{CONVERSION_ID}`). The template does this for you. In the **postback URL** you write *Kayzen's* parameter (`bid_id`) and *ClickFlare's* token (`{external_id}`). The parameter name is the same on both sides.

## Before you start

* **Set up your own tracking domain.** Run the campaign and the postback on your own custom domain. Shared domains get flagged by networks and blocked by browsers. See [Custom Domains](https://clickflare.com/docs/en/settings/custom-domains.md).
* **Have an offer ready in ClickFlare**, and its affiliate network set up to post conversions back to ClickFlare. See [Creating an Offer](https://clickflare.com/docs/en/tracking/creating-an-offer-1.md) and [Adding an Affiliate Network](https://clickflare.com/docs/en/tracking/adding-an-affiliate-network.md).
* **Get your Kayzen Event API key.** Each app or website in Kayzen has its own key. Click your name in the top-right corner of Kayzen and select **Switch to Admin Console**. Advertiser Admins land on the **Advertiser Settings** page. Enterprise Admins land on **Advertiser Overview**: click the advertiser name. Scroll to the **App/Website** section and click the app or website you are promoting. In the event API integration details box, scroll to the bottom and copy the **API Key** field.
* **Decide which events Kayzen should receive.** Kayzen optimizes on the events you send it. If your funnel has several steps (registration, then purchase), decide now whether to send one event or several, and what to call each. See [Tracking several events](#tracking-several-events).

***

## Step 1 – Create the campaign and the Kayzen traffic source

1. Go to **Campaigns** and click **New**.
2. In **Traffic Source**, open the dropdown and click **+ New Traffic Source**.
3. Type `kayzen` in the search box and select the **Kayzen** template.
4. Enter a **Name**, for example `Kayzen`.
5. Leave **Cost currency** on **USD** unless your Kayzen account is billed in another currency.

The template fills in the **Parameters** table for you:

| Name | TS Parameter | TS Token (Kayzen macro) | ClickFlare Token | What it carries |
| - | - | - | - | - |
| Cost | *(empty)* | *(empty)* | `{cost}` | Nothing. Kayzen passes no cost here. See [Cost](#cost). |
| externalId | `bid_id` | `{CONVERSION_ID}` | `{external_id}` | Kayzen's unique bid ID, which identifies the click. Required for the postback. |
| Campaign name | `campaign_name` | `{CAMPAIGN_NAME}` | `{trackingField1}` | The campaign name you set in Kayzen |
| Creative name | `creative_name` | `{CREATIVE_NAME}` | `{trackingField2}` | The creative name you set in Kayzen |
| Exchange name | `exchange_name` | `{EXCHANGE_NAME}` | `{trackingField3}` | The ad exchange that showed the ad |
| App name | `app_name` | `{APP_NAME}` | `{trackingField4}` | The publisher app's name, as sent in the bid request |
| App domain | `app_domain` | `{APP_DOMAIN}` | `{trackingField5}` | The domain of the publisher app or site |
| Device OS name | `device_os_name` | `{DEVICE_OS_NAME}` | `{trackingField6}` | The operating system of the user's device |
| Manufacturer name | `manufacturer_name` | `{MANUFACTURER_NAME}` | `{trackingField7}` | The device manufacturer |
| Model name | `model_name` | `{MODEL_NAME}` | `{trackingField8}` | The device model |
| Carrier name | `carrier_name` | `{CARRIER_NAME}` | `{trackingField9}` | The user's mobile carrier |

![The Kayzen template's Parameters table in ClickFlare, with Kayzen's macros pre-filled](https://mintcdn.com/clickflare/0jaeWC_DJvLt2SMH/images/integrations/templates/kayzen/parameters.png?fit=max\&auto=format\&n=0jaeWC_DJvLt2SMH\&q=85\&s=a266be1a639d3ccf690084b9025c2135)

Each tracking field becomes a column you can group reports by. **Exchange name** and **App name** are the ones you will use most: they tell you which exchanges and publisher apps convert, so you can block or bid up inventory in Kayzen.

> [!WARNING]
>
> Don't change or remove the `externalId` row. Kayzen calls `{CONVERSION_ID}` its mandatory macro: without it in the campaign URL, ClickFlare stores no bid ID, and Kayzen can't match any event you send.

To pass more Kayzen data, click **Add Parameter**, give it a name and parameter, and enter the Kayzen macro as the **TS Token**. ClickFlare assigns the next free tracking field. Useful ones from Kayzen's macro list:

| Macro | What it carries |
| - | - |
| `{CAMPAIGN_ID}` | Kayzen's numeric campaign ID |
| `{CREATIVE_ID}` | Kayzen's numeric creative ID |
| `{APP_BUNDLE}` | The publisher app's bundle |
| `{APP_ID}` | The exchange's ID for the publisher app. Combine it with `{EXCHANGE_ID}` to block or allow apps. |
| `{COUNTRY_CODE}` | The user's country, ISO 3166-1 alpha-3 |
| `{DEVICE_OS_VERSION}` | The operating system version |

Don't add static values such as a cachebuster or a timestamp to the URL. Kayzen recommends using its macros only.

## Step 2 – Set up the postback

The postback is what sends conversions to Kayzen. It lives on the traffic source, so every campaign that uses this Kayzen traffic source sends conversions the same way.

1. In the **New Traffic Source** form, scroll to **Passing conversion info to traffic source**.
2. Turn on **Traffic source postback URL**. The template's postback appears:

```text theme={null}
https://api-events.kayzen.io/v1/ev?tp=direct&api_key=Website_API_key&app_event=name_of_the_event&can_claim=1&bid_id={external_id}
```

![The Traffic source postback URL switched on, showing the Kayzen template's postback](https://mintcdn.com/clickflare/0jaeWC_DJvLt2SMH/images/integrations/templates/kayzen/postback.png?fit=max\&auto=format\&n=0jaeWC_DJvLt2SMH\&q=85\&s=56611a229f0ef93dd6a282b6e5507990)

3. Replace the two placeholders:

| In the template | Replace it with | Why, or where to find it |
| - | - | - |
| `api_key=Website_API_key` | Your app's or website's API key | **Switch to Admin Console**, then the **App/Website** section in Kayzen. See [Before you start](#before-you-start). |
| `app_event=name_of_the_event` | The event this postback reports, for example `purchase` or `registration` | Your choice. Use the same name you agreed with Kayzen for optimization. |

4. Add the revenue. The template sends none. If your payouts are in USD, add `&revenue_USD={payout}` at the end. For another currency, add `&revenue={payout}&currency={payout_currency}` instead.

Leave `tp=direct` and `can_claim=1` as they are. `can_claim=1` tells Kayzen the event is attributed to its click. The result, for a purchase in USD:

```text theme={null}
https://api-events.kayzen.io/v1/ev?tp=direct&api_key=YOUR_API_KEY&app_event=purchase&can_claim=1&bid_id={external_id}&revenue_USD={payout}
```

5. In the dropdown on the left, choose the ClickFlare event that should fire the postback. Keep **Conversions** to send every conversion. If your final action is a custom conversion (for example `purchase`), choose that instead.
6. Click **Save**. You are back in the campaign editor with the Kayzen traffic source selected.

> [!WARNING]
>
> Replace `Website_API_key` with your real API key: a postback without it is rejected or credited to nothing.

Each app or website in Kayzen has its own API key. If you promote several, create one Kayzen traffic source per app or website, each with its own key.

To learn what each postback token does, see [How to Configure a Traffic Source S2S Postback URL](https://clickflare.com/docs/en/tracking/how-to-configure-a-traffic-source-s2s-postback-url.md).

## Step 3 – Finish the campaign and copy its URL

1. Name the campaign.
2. Set the **Cost Model** to **CPC** and enter your average cost per click. See [Cost](#cost).
3. Choose **Redirect** tracking. Kayzen opens the campaign URL as the click URL after recording the click.
4. Click **Next** and, on **Destination**, add your lander (optional) and your offer.
5. Save, open **Tracking**, select your own tracking domain and copy the **campaign URL**.

The campaign URL already contains every Kayzen macro from the template, for example `bid_id={CONVERSION_ID}` and `exchange_name={EXCHANGE_NAME}`.

If you use a lander, its call-to-action must link to the ClickFlare **click URL**, not to the offer directly. Otherwise the visit reaches the offer without a ClickFlare click ID, and the conversion cannot be traced back to Kayzen.

See [Creating a Campaign in ClickFlare](https://clickflare.com/docs/en/campaigns/creating-a-campaign-in-click-flare.md).

## Step 4 – Create the campaign in Kayzen

1. In Kayzen, create the campaign with your targeting, bid and creatives as usual.
2. Paste the ClickFlare campaign URL as the campaign's **click URL**.
3. Launch the campaign.

Paste the URL exactly as ClickFlare gives it. Kayzen replaces each `{...}` macro when the ad is clicked.

For image and native creatives, Kayzen records the click and then calls your click URL. HTML creatives are different: Kayzen doesn't track their clicks by default. In an HTML creative, put Kayzen's `{HTML_CLICK_URL}` macro where the click URL goes, so Kayzen records the click before sending the user to ClickFlare.

## Step 5 – Test the integration

1. Run a small amount of traffic, or click one of your own ads, and complete the offer the way a real user would.
2. In ClickFlare, go to **Logs → Postback Status** and filter by the campaign. A successful request to `api-events.kayzen.io` confirms ClickFlare sent the postback. Open it and check that `bid_id` holds a real value, not nothing.
3. In Kayzen's reporting, check that the event appears on the campaign under the `app_event` name you used.
4. If it doesn't, compare the bid ID in the postback with the **External ID** of the visit in ClickFlare. They must match.

If the test conversion doesn't show in ClickFlare at all, open **Logs → Event Logs** to see whether the conversion arrived and which event it was recorded as.

***

## Tracking several events

Kayzen can receive several events from the same campaign, for example a registration and a purchase. Each event needs its own postback. Only the `app_event` value changes:

```text theme={null}
https://api-events.kayzen.io/v1/ev?tp=direct&api_key=YOUR_API_KEY&app_event=registration&can_claim=1&bid_id={external_id}
https://api-events.kayzen.io/v1/ev?tp=direct&api_key=YOUR_API_KEY&app_event=purchase&can_claim=1&bid_id={external_id}&revenue_USD={payout}
```

1. In ClickFlare, create a [custom conversion](https://clickflare.com/docs/en/settings/custom-conversions.md) for each step, for example `lead` and `purchase`.
2. On the Kayzen traffic source, click **+ Another postback URL** once per extra event.
3. Map each postback to its ClickFlare event: the `lead` custom conversion to the `app_event=registration` URL, `purchase` to `app_event=purchase`.
4. Test each event.

> **Rules for multi-event postbacks**
>
> * One postback per event. Don't combine events in one URL.
> * Event names are free text, for example `landing`, `registration` or `purchase`. Keep them consistent: Kayzen reports and optimizes on the exact name.
> * Add `revenue_USD={payout}` only to events that carry revenue.
> * All postbacks on one traffic source use the same API key, so they all report to the same app or website.

> **Sending only one event**
>
> If Kayzen should only learn from your final sale, keep a single postback and map it to that event. Earlier steps still show in ClickFlare. They just don't reach Kayzen.
>
> To send a postback only for some conversions, for example only those above a certain payout, use **Event filter** under the postback to add conditions.

## Cost

The template passes no cost. Its Cost row has no parameter and no macro, and Kayzen's macro list has no price or cost macro. ClickFlare has no cost integration for Kayzen either.

Set the campaign's **Cost Model** to **CPC** and enter your average cost per click. Kayzen buys impressions in real-time auctions, so divide your Kayzen spend by your Kayzen clicks to get it. A CPM bid divided by 1,000 doesn't work here: on in-app inventory, most impressions are not clicks.

> [!NOTE]
>
> Compare the **Cost** column with your Kayzen spend after the first days. When they differ, correct them with a [manual cost upload](https://clickflare.com/docs/en/settings/manual-cost-upload.md), and update the CPC value on the campaign.

See [Cost Models](https://clickflare.com/docs/en/core-platform-concepts/cost-models.md) and [How to Set Up Traffic Source Cost Tracking](https://clickflare.com/docs/en/tracking/how-to-setup-traffic-source-cost-tracking.md).

## Delayed revenue

If your offer reports revenue hours or days after the click, see [Sending Delayed Revenue to Traffic Sources](https://clickflare.com/docs/en/advanced-tracking-configuration/how-to-send-delayed-revenue-to-traffic-sources.md) to pass that revenue to Kayzen once it arrives.

***

## Troubleshooting

> **Postbacks are sent but Kayzen shows no events**
>
> * Open the request in **Logs → Postback Status** and check that `bid_id` holds a real value.
> * `api_key` still says `Website_API_key`, or holds the key of another app or website.
> * The campaign URL in Kayzen is missing `bid_id={CONVERSION_ID}`, or the macro was edited. Copy the URL from ClickFlare again.

> **Conversions show in ClickFlare but not in Kayzen**
>
> * **Traffic source postback URL** is off on the Kayzen traffic source.
> * **Disable sending postbacks to traffic source** is on in the campaign.
> * The postback is mapped to a different event than the one the conversion logged. Check **Logs → Event Logs** to see which event was recorded.
> * Check **Logs → Postback Status**: a failed request shows the status code Kayzen returned.

> **Kayzen shows events with no revenue**
>
> The template sends no revenue. Add `&revenue_USD={payout}` to the postback, or `&revenue={payout}&currency={payout_currency}` for payouts in another currency.

> **Exchange or app columns are empty**
>
> The macros were not replaced, usually because the URL was edited, or because an HTML creative links to the ClickFlare URL without Kayzen's click macro. Paste the campaign URL from ClickFlare unchanged. See [Traffic Source Tokens Arriving Empty](https://clickflare.com/docs/en/troubleshooting/tokens-arriving-empty.md).

For the general checklist, see [Conversions not showing](https://clickflare.com/docs/en/troubleshooting/conversions-not-showing.md).

***

**FREQUENTLY ASKED QUESTIONS**

> **Q1:** Can I use the same Kayzen traffic source for all my Kayzen campaigns?

**A1:** Yes, as long as they promote the same app or website. The API key in the postback belongs to one app or website. Create a separate Kayzen traffic source for each one you promote.

> **Q2:** What does `can_claim=1` do?

**A2:** It tells Kayzen the event is attributed to a Kayzen click. Kayzen's default is `0`, an unattributed event. Keep `1`, since ClickFlare only sends the postback for visits that came from Kayzen.

> **Q3:** Should I use Redirect or Direct tracking with Kayzen?

**A3:** Redirect. Kayzen sends users to your click URL after it records the click, so the campaign URL must be a ClickFlare redirect. See [Direct Campaign Tracking](https://clickflare.com/docs/en/campaigns/direct-campaign-tracking.md) for when Direct applies.

> **Q4:** Kayzen's documentation shows a different host, `api-events.eventstracker.io`. Which one should I use?

**A4:** Keep the template's `api-events.kayzen.io`, which Kayzen's tracker integration guides use. If Kayzen's team gives you the other host, use theirs. The parameters are the same on both.

## Related

> **[Traffic source postbacks](https://clickflare.com/docs/en/tracking/how-to-configure-a-traffic-source-s2s-postback-url.md)**
>
> Every token you can use in a postback.

> **[Custom conversions](https://clickflare.com/docs/en/settings/custom-conversions.md)**
>
> Split registrations and purchases into separate events.

> **[Cost models](https://clickflare.com/docs/en/core-platform-concepts/cost-models.md)**
>
> How CPC, CPA and RevShare costs are calculated.

> **[Conversions not showing](https://clickflare.com/docs/en/troubleshooting/conversions-not-showing.md)**
>
> The general checklist when postbacks don't arrive.


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