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

# Bitmedia Click & Conversion Tracking Setup

> Set up Bitmedia conversion tracking in ClickFlare: pass {clickid}, {source} and {bid}, then add Bitmedia's per-conversion postback with {external_id}.

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

Bitmedia is a self-serve ad network for crypto, Web3 and finance audiences. It sells display placements (text, image, responsive, HTML5 and playable ads) on CPC and CPM. This guide sets up Bitmedia as a traffic source in ClickFlare. It covers passing Bitmedia's click data into your reports and sending conversions back to Bitmedia through the postback Bitmedia generates for each conversion you create there.

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

## At a glance

| | |
| - | - |
| **Ad formats** | Text, responsive, image, HTML5 and playable display ads |
| **Click ID macro** | `{clickid}` (also written `{click_id}`) |
| **Conversion tracking** | Per-conversion postback code generated in Bitmedia. The template has no postback URL: you add Bitmedia's. |
| **Payout passed back** | Yes, once you put `{payout}` in place of Bitmedia's `{ConversionValueUSD}` |
| **Multiple events** | Yes. One Bitmedia conversion, and one postback, per event. |
| **Cost** | Passed by the template in `bid` (`{bid}`). Right on CPC. Wrong on CPM. Cost Model: **Not Tracked** on CPC. |
| **Conversion API** | No |

## How it works

**1. Bitmedia sends the click**

A visitor clicks your ad. Bitmedia opens your ClickFlare campaign URL and fills in its macros: the click ID in `clickid`, your bid in `bid`, plus the publisher source, the ad unit, the country and the cost type.

**2. ClickFlare stores the Bitmedia click ID**

ClickFlare saves the value of `clickid` as the visit's **External ID**, records the cost, and redirects the visitor 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 Bitmedia**

ClickFlare fires the postback you copied from Bitmedia, with `{external_id}` replaced by the stored Bitmedia click ID and `{payout}` by the revenue. Bitmedia counts it under the conversion that postback belongs to.

> [!NOTE]
>
> The mirror to keep straight: in the **campaign URL** you write *ClickFlare's* parameter (`clickid`) and *Bitmedia's* macro (`{clickid}`). The template does this for you. In the **postback URL** you keep *Bitmedia's* parameters and put *ClickFlare's* tokens where Bitmedia's placeholders were: `{external_id}` for `{cookie.bm_click_id}`, `{payout}` for `{ConversionValueUSD}`.

## 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](/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](/docs/en/tracking/creating-an-offer-1.md) and [Adding an Affiliate Network](/docs/en/tracking/adding-an-affiliate-network.md).
* **Decide which conversions Bitmedia should receive.** Each event you send needs its own conversion in Bitmedia, for example a registration and a purchase. Decide now whether to send one or several. See [Tracking several events](#tracking-several-events).

***

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

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

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

| Name | TS Parameter | TS Token (Bitmedia macro) | ClickFlare Token | What it carries |
| - | - | - | - | - |
| External ID | `clickid` | `{clickid}` | `{external_id}` | Bitmedia's click ID. Needed for the postback. |
| Cost | `bid` | `{bid}` | `{cost}` | Your bid. Per click on CPC, per single impression on CPM. See [Cost](#cost). |
| Source ID | `source` | `{source}` | `{trackingField1}` | The publisher source ID |
| Ad Unit | `subid` | `{subid}` | `{trackingField2}` | The ad unit (ad block) the ad showed in |
| Country | `country_code` | `{country_code}` | `{trackingField3}` | The visitor's country, as a two-letter code |
| Cost Type | `cost_type` | `{cost_type}` | `{trackingField4}` | `CPC` or `CPM`, the pricing model of the ad group |

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

Each tracking field becomes a column you can group reports by. **Source ID** is the one you will use most. It is the same source ID Bitmedia shows under **Statistics by Source**, so you can match ClickFlare's revenue to Bitmedia's sources and exclude the ones that lose money. **Cost Type** tells you, per visit, whether the Cost column can be trusted.

> [!WARNING]
>
> Don't change or remove the External ID row. Without `clickid={clickid}` in the campaign URL, ClickFlare has no Bitmedia click ID to send back, and Bitmedia cannot match any conversion.

Bitmedia has a few more macros you can add with **Add Parameter**: `{ip}` (the visitor's IP), `{cost_amount}` (your bid, per 1,000 impressions on CPM) and `{cost_currency}` (the bid currency). Enter the macro as the **TS Token**. ClickFlare assigns the next free tracking field.

## Step 2 – Set up conversion tracking

The template has no postback URL, because Bitmedia doesn't use one fixed URL. Bitmedia generates a postback for each conversion you create in your account. You copy that postback into ClickFlare once, and it lives on the traffic source from then on.

### Create the conversion in Bitmedia

1. In the Bitmedia Advertiser's Dashboard, open **Conversions**.
2. Click **Create conversion**.
3. Fill in the **New conversion** form:
   * **Conversion name** and **Description**: anything that helps you recognize it, for example `ClickFlare – purchase`.
   * **Conversion type**: **Landing view**, **Registration**, **Purchase** or **Custom**.
   * **Target event ID**: any alphanumeric value.
4. Click **Save**. The conversion is created with the status **Stopped**.
5. Click the toggle next to **Stopped** and confirm with **Yes**. The status changes to **Active**.
6. Click **Get code**.

Bitmedia shows three codes: a **General Code** and a **Client Side URL** for your own website, and a **Postback code** for your server. ClickFlare uses the **Postback code**. You don't need the other two. They are for advertisers who place Bitmedia's tag on their own site.

### Add the postback to the traffic source in ClickFlare

1. Copy the URL from the **Postback code**. It starts with `https://api.bitmediacdn.com`. Copy the URL only, without a leading `GET`.
2. Back in the **New Traffic Source** form, scroll to **Passing conversion info to traffic source**.
3. Turn on **Traffic source postback URL** and paste the URL.
4. Replace Bitmedia's two placeholders with ClickFlare tokens:

| In Bitmedia's URL | Replace with | Why |
| - | - | - |
| `{cookie.bm_click_id}` | `{external_id}` | The Bitmedia click ID ClickFlare stored from the click |
| `{ConversionValueUSD}` | `{payout}` | The conversion's revenue |

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

> [!WARNING]
>
> Replace the whole placeholder, braces included. ClickFlare reads anything in braces as a token. `{cookie.bm_click_id}` and `{ConversionValueUSD}` are not ClickFlare tokens, so if they stay, ClickFlare sends them as empty or literal text and Bitmedia can't match the conversion.

Bitmedia reads the conversion value as USD. If your offers pay in another currency, set the offer's payout in USD or check how ClickFlare converts it. See [Multicurrency in ClickFlare](/docs/en/tracking/multicurrency-support-in-click-flare-how-it-works.md).

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

### If Bitmedia doesn't match the conversions

Bitmedia passes its click ID in two ways: through the `{clickid}` macro the template uses, and as a `bm_click_id` parameter it appends to the landing URL by itself. Bitmedia's postback is written for `bm_click_id`. If your first conversions show in ClickFlare's **Logs → Postback Status** as sent but never appear in Bitmedia, read the ID from `bm_click_id` instead:

1. Open the Bitmedia traffic source.
2. In the External ID row, change **TS Parameter** to `bm_click_id` and clear the **TS Token**. Bitmedia adds `bm_click_id` to the URL itself, so no macro is needed.
3. Save, copy the campaign URL again and update it in Bitmedia.

The postback stays the same: `{external_id}` now holds the `bm_click_id` value.

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

1. Name the campaign.
2. Set the **Cost Model**. Use **Not Tracked** for CPC ad groups, so ClickFlare uses the cost Bitmedia passes. For CPM, see [Cost](#cost).
3. Choose **Redirect** or **Direct** tracking. Redirect is the usual choice for Bitmedia.
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 Bitmedia macro from the template, for example `clickid={clickid}` and `source={source}`.

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 Bitmedia.

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

## Step 4 – Create the campaign in Bitmedia

1. In Bitmedia, open **All Campaigns** and click **Add campaign**. Name it.
2. Create an ad group. Choose the pricing model (**CPC** or **CPM**), the bid and the daily limit, then set targeting.
3. Open the ad group's **Creatives** tab and click **Add creative**.
4. Use the ClickFlare campaign URL as the creative's destination URL.
5. Click **Apply for Approval**. Bitmedia reviews each ad before it runs. Only funded campaigns can be activated.

Paste the URL exactly as ClickFlare gives it. Bitmedia replaces each `{...}` macro when the ad is clicked. Don't add Bitmedia's UTM builder parameters on top unless you also want them in Google Analytics. They don't affect ClickFlare.

## Step 5 – Test the integration

Bitmedia doesn't document a test mode. Check the setup with your first real conversions.

1. Once the ads run, open the campaign's report in ClickFlare and group by Source ID. You should see real source IDs. Open a visit and check that its External ID holds a value, not the literal text `{clickid}`.
2. When the first conversion arrives, go to **Logs → Postback Status** and filter by the campaign. A successful request to `api.bitmediacdn.com` confirms ClickFlare sent the postback.
3. In Bitmedia, open **Conversions**. The **Count** column should go up, and the **Amount** column (in USD) should show the payout.
4. For details per conversion, open the ad group's **Conversion logs**. It lists time, creative, country, OS, device, browser and IP.

If ClickFlare sent the postback and Bitmedia's count doesn't move, see [If Bitmedia doesn't match the conversions](#if-bitmedia-doesnt-match-the-conversions).

***

## Tracking several events

Bitmedia tracks as many events as you create conversions. Each one has its own **Target event ID** and its own postback code.

1. In ClickFlare, create a [custom conversion](/docs/en/settings/custom-conversions.md) for each step, for example `registration` and `purchase`.
2. In Bitmedia, create one conversion per step, activate it and copy its **Postback code**.
3. On the Bitmedia traffic source, click **+ Another postback URL** once per extra event and paste each postback. Replace the placeholders in each, as in Step 2.
4. Map each postback to its ClickFlare event: the `registration` custom conversion to the Registration conversion's URL, `purchase` to the Purchase one.

> **Where Bitmedia shows each event**
>
> * **Conversions** page: total **Count** and the **Amount** column (in USD) per conversion.
> * **Ad Group → Statistics → Statistics by Source**: pick a conversion type to see conversions and value per source ID.
> * **Reports**: use the **Conversions** and **Conversions Amount** metrics to break events down further.

> **Sending only one event**
>
> If Bitmedia should only learn from your final sale, create one conversion in Bitmedia, keep a single postback and map it to that event. Earlier steps still show in ClickFlare. They just don't reach Bitmedia.
>
> 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 cost in the URL. The Cost row sends Bitmedia's `{bid}` macro, which is your bid, and ClickFlare records it as the visit's cost.

* **CPC ad groups.** `{bid}` is the price of a click. Set the **Cost Model** to **Not Tracked** so ClickFlare uses it.
* **CPM ad groups.** Bitmedia's `{bid}` holds the price of a *single impression* (your CPM bid divided by 1,000). ClickFlare would record that tiny amount as the cost of each visit, far below your real spend, because many impressions lead to one click.

> [!NOTE]
>
> For CPM ad groups, don't rely on the Cost row. Display ads need many impressions per click, so a per-visit cost can't be worked out from the bid. Set the **Cost Model** to **CPC** with your real cost per click from Bitmedia's stats, or keep **Not Tracked** and correct spend with a [manual cost upload](/docs/en/settings/manual-cost-upload.md). The **Cost Type** column shows which ad groups are CPM.

With **Smart Bid Strategy**, Bitmedia adjusts your bids to publisher floor prices, so the recorded cost may drift from your real spend. Compare the **Cost** column with Bitmedia's spend after launch.

ClickFlare has no cost-tracking API integration for Bitmedia. See [Cost Models](/docs/en/core-platform-concepts/cost-models.md).

## Delayed revenue

If you run search arbitrage (RSOC or AFD) behind Bitmedia, the feed reports revenue hours or days after the click. To pass that revenue to Bitmedia once it arrives, see [Sending Delayed Revenue to Traffic Sources](/docs/en/advanced-tracking-configuration/how-to-send-delayed-revenue-to-traffic-sources.md).

***

## Troubleshooting

> **Conversions show in ClickFlare but not in Bitmedia**
>
> * **Traffic source postback URL** is off, or empty, on the Bitmedia traffic source. The template has no postback until you add Bitmedia's.
> * The conversion in Bitmedia is still **Stopped**. Activate it.
> * `{cookie.bm_click_id}` or `{ConversionValueUSD}` is still in the URL.
> * **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**.
> * The postback is sent but not matched. Switch the External ID row to `bm_click_id`, as in [If Bitmedia doesn't match the conversions](#if-bitmedia-doesnt-match-the-conversions).

> **Bitmedia counts conversions but Amount is 0**
>
> `{ConversionValueUSD}` was removed instead of replaced with `{payout}`, or the offer posts no payout to ClickFlare. Check the conversion's payout in ClickFlare first.

> **Cost in ClickFlare is far below Bitmedia's spend**
>
> The ad group buys on CPM, and `{bid}` is the price of one impression. See [Cost](#cost).

> **Source or ad unit columns are empty**
>
> The macros were not replaced, usually because the URL was edited. Paste the campaign URL from ClickFlare unchanged. See [Traffic Source Tokens Arriving Empty](/docs/en/troubleshooting/tokens-arriving-empty.md).

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

***

**FREQUENTLY ASKED QUESTIONS**

> **Q1:** Why doesn't the Bitmedia template come with a postback URL?

**A1:** Bitmedia generates the postback per conversion inside your account, so there is no single URL a template could carry. You create the conversion in Bitmedia and paste its postback once.

> **Q2:** Can I use the same Bitmedia traffic source for all my Bitmedia campaigns?

**A2:** Yes. The postback is set once on the traffic source and every campaign using it sends conversions the same way. Create a second traffic source only if a campaign should report to a different Bitmedia conversion.

> **Q3:** Do I need Bitmedia's General Code on my lander?

**A3:** No. The General Code and Client Side URL are for tracking conversions on your own website. With ClickFlare, the conversion comes from the offer's postback, and ClickFlare sends it to Bitmedia server to server.

> **Q4:** Should I use Redirect or Direct tracking with Bitmedia?

**A4:** Redirect is the usual choice. Use Direct only if Bitmedia must see your lander's domain as the destination. See [Direct Campaign Tracking](/docs/en/campaigns/direct-campaign-tracking.md).

## Related

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

> **[Custom conversions](/docs/en/settings/custom-conversions.md)**
>
> Map each Bitmedia conversion to its own event.

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

> **[Conversions not showing](/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.