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

# TwinRed Conversion Tracking & Postback Setup

> Set up TwinRed conversion tracking in ClickFlare: the {transactionId} click ID, a Manage Trackers tracker ID in the S2S postback, cv payout and CPM cost.

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

TwinRed is a self-serve real-time-bidding ad platform with adult and mainstream inventory from direct publishers and ad exchanges. It sells popunders, interstitials, banners and video (pre-roll, outstream and sliders) on dynamic CPM, fixed CPM and CPC. This guide sets up TwinRed as a traffic source in ClickFlare. It covers passing TwinRed's click data into your reports and sending conversions, with their value, back to TwinRed so its statistics and your stats agree.

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

## At a glance

| | |
| - | - |
| **Ad formats** | Popunders, interstitials, banners, video pre-roll, outstream video, video sliders |
| **Click ID macro** | `{transactionId}`, mandatory for conversion tracking |
| **Conversion tracking** | S2S postback to `ad.twinrdengine.com`, one tracker ID per conversion event |
| **Payout passed back** | Yes, in the `cv` parameter, when the tracker allows a dynamic conversion value |
| **Multiple events** | Yes, one tracker and one postback per event |
| **Cost** | Passed by the template as TwinRed's `{cost}` macro. Check it against your spend on CPM. See [Cost](#cost). |
| **Conversion API** | No |

## How it works

**1. TwinRed sends the click**

A visitor clicks your ad. TwinRed opens your ClickFlare campaign URL and fills in its macros: the transaction ID in `transaction_id`, the cost in `cost`, plus the campaign, ad, creative, source site, format, country and other details.

**2. ClickFlare stores the TwinRed transaction ID**

ClickFlare saves the value of `transaction_id` 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 TwinRed**

ClickFlare fires the TwinRed postback, replacing `{external_id}` with the stored transaction ID and `{payout}` with the revenue. TwinRed matches it to the original click and records it under the tracker in the URL.

> [!NOTE]
>
> The mirror to keep straight: in the **campaign URL** you write *ClickFlare's* parameter (`transaction_id`) and *TwinRed's* macro (`{transactionId}`). The template does this for you. In the **postback URL** you write *TwinRed's* parameter (`id`) and *ClickFlare's* token (`{external_id}`). TwinRed's macros use curly braces like ClickFlare's tokens, so check which side of the mirror you are on.

## 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).
* **Create a tracker in TwinRed.** In your TwinRed advertiser account, a tracker is a conversion event, and its ID goes into the postback URL. Step 2 shows how.
* **Decide which conversions TwinRed should receive.** Each event you send needs its own tracker. If your funnel has several steps (lead, then sale), decide now whether to send one event or several. See [Tracking several events](#tracking-several-events).

***

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

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

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

| Name | TS Parameter | TS Token (TwinRed macro) | ClickFlare Token | What it carries |
| - | - | - | - | - |
| External ID | `transaction_id` | `{transactionId}` | `{external_id}` | TwinRed's transaction ID for the click. Required for the postback. |
| Cost | `cost` | `{cost}` | `{cost}` | TwinRed's cost. See [Cost](#cost). |
| Campaign ID | `campaign_id` | `{campaignId}` | `{trackingField1}` | Your TwinRed campaign ID |
| Campaign Name | `campaign_name` | `{campaignName}` | `{trackingField2}` | Your TwinRed campaign name |
| Ad ID | `ad_id` | `{adId}` | `{trackingField3}` | The ad |
| Creative ID | `creative_id` | `{creativeId}` | `{trackingField4}` | The creative |
| Source | `source` | `{source}` | `{trackingField5}` | The traffic source, as TwinRed identifies it |
| Source Site | `source_site` | `{sourceSite}` | `{trackingField6}` | The site that showed the ad |
| Domain | `domain` | `{domain}` | `{trackingField7}` | The domain that showed the ad |
| Format | `format` | `{format}` | `{trackingField8}` | The ad format, for example popunder or banner |
| Country | `country` | `{country}` | `{trackingField9}` | The visitor's country |
| OS | `os` | `{os}` | `{trackingField10}` | The visitor's operating system |
| Browser | `browser` | `{browser}` | `{trackingField11}` | The visitor's browser |

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

Each tracking field becomes a column you can group reports by. **Source**, **Source Site** and **Domain** are the ones you will use most: they tell you which sources convert, so you can blacklist or whitelist them in TwinRed.

> [!WARNING]
>
> Don't change or remove the **External ID** row. Without `{transactionId}` in the campaign URL, ClickFlare has nothing to send back in the postback, and TwinRed cannot match conversions.

To pass more TwinRed data, click **Add Parameter**, give it a name and parameter, and enter the TwinRed macro as the **TS Token**. ClickFlare assigns the next free tracking field. TwinRed's macro list also includes `{region}`, `{carrier}`, `{keywords}`, `{sspId}`, `{sourceName}`, `{adName}`, `{creativeName}`, `{campaignGroupId}` and `{campaignGroupName}`. When you set up a creative in TwinRed, the "i" icon shows each macro with its description.

## Step 2 – Set up the postback

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

### Get your tracker ID from TwinRed

1. In your TwinRed advertiser account, open **Manage Trackers** from the left menu.
2. Enter a **Tracker name** for the conversion event, for example `sale`, and click **Create**.
3. To have TwinRed record the payout ClickFlare sends, tick **Allow dynamic conversion value** on the tracker. Otherwise TwinRed ignores the value in the postback.
4. Expand the tracker. Its **Postback URL (S2S)** looks like this:

```text theme={null}
https://ad.twinrdengine.com/conversion/64164?id=INSERT_TRANSACTION_ID
```

5. Copy the number after `/conversion/`, here `64164`. That is your tracker ID.

### Add it to the traffic source in ClickFlare

1. Back 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://ad.twinrdengine.com/conversion/REPLACE_WITH_TRACKER_ID?id={external_id}&cv={payout}
```

![The Traffic source postback URL switched on, showing the TwinRed template's postback](https://mintcdn.com/clickflare/JnEca3lx3v_LxcNj/images/integrations/templates/twinred/postback.png?fit=max\&auto=format\&n=JnEca3lx3v_LxcNj\&q=85\&s=5477194baff2c1cb43f2645571941d55)

It already sends the transaction ID (`{external_id}`) in `id` and the payout (`{payout}`) in `cv`, both as ClickFlare tokens. `INSERT_TRANSACTION_ID` in TwinRed's own URL is where `{external_id}` goes.

3. Replace `REPLACE_WITH_TRACKER_ID` with your tracker ID. The result:

```text theme={null}
https://ad.twinrdengine.com/conversion/64164?id={external_id}&cv={payout}
```

4. 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.
5. Click **Save**. You are back in the campaign editor with the TwinRed traffic source selected.

> [!WARNING]
>
> Replace `REPLACE_WITH_TRACKER_ID` with the number from your tracker's postback URL. The tracker ID is part of the path, not a parameter, so keep the `?` after it. If the placeholder stays in the postback, TwinRed cannot record the conversion.

`cv` carries your payout as the conversion value. It only counts when **Allow dynamic conversion value** is ticked on the tracker. If your offers pay in a currency other than USD, 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).

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

1. Name the campaign.
2. Set the **Cost Model**: **Not Tracked** to use the cost TwinRed passes, after checking it. See [Cost](#cost).
3. Choose **Redirect** or **Direct** tracking. Redirect is the usual choice for TwinRed's popunder and banner traffic.
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 TwinRed macro from the template, for example `transaction_id={transactionId}` and `source_site={sourceSite}`.

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

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

## Step 4 – Create the campaign in TwinRed

1. In TwinRed, create a campaign.
2. Configure the ad format, targeting, budget, pricing model (CPM or CPC) and bid.
3. In the **Creative** tab, set up your creative and paste the ClickFlare campaign URL as its destination URL.
4. Submit it. Every creative goes through a compliance review before it serves.

Paste the URL exactly as ClickFlare gives it. TwinRed replaces each `{...}` macro with real values when the ad is clicked.

## Step 5 – Test the integration

1. Once the campaign runs, check the first visits in ClickFlare. The **Source Site** column should show real sites, not the text `{sourceSite}`.
2. Complete a test conversion on your offer, or post one to ClickFlare from your affiliate network.
3. In ClickFlare, go to **Logs → Postback Status** and filter by the campaign. A successful request to `ad.twinrdengine.com` confirms ClickFlare sent the postback.
4. In TwinRed, check the campaign statistics. The conversion appears under the tracker you created.

***

## Tracking several events

TwinRed tracks each conversion event with its own tracker. To send a lead and a sale, create two trackers in **Manage Trackers** and use one postback per tracker:

```text theme={null}
https://ad.twinrdengine.com/conversion/LEAD_TRACKER_ID?id={external_id}&cv={payout}
https://ad.twinrdengine.com/conversion/SALE_TRACKER_ID?id={external_id}&cv={payout}
```

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

> **Rules for multi-event postbacks**
>
> * One tracker per event in TwinRed, one postback per tracker in ClickFlare.
> * The tracker ID in the path is what tells TwinRed which event it is. There is no event parameter.
> * Tick **Allow dynamic conversion value** on each tracker that should record the payout.

> **Sending only one event**
>
> If TwinRed should only see your final sale, keep a single postback and map it to that event. Earlier steps still show in ClickFlare. They just don't reach TwinRed.
>
> 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 through the **Cost** row, which sends TwinRed's `{cost}` macro. ClickFlare records it as the visit's cost. On the campaign, set the **Cost Model** to **Not Tracked** so ClickFlare uses the cost passed in the URL.

TwinRed doesn't publish what `{cost}` holds on each pricing model. Its macro descriptions are only shown inside the account, under the "i" icon in creative setup. Check it there before you rely on it.

> [!NOTE]
>
> Most TwinRed buying is on CPM. If `{cost}` carries the CPM price, ClickFlare would record a price per 1,000 impressions as the cost of each visit and overstate spend about 1,000 times. After launch, compare the **Cost** column with your TwinRed spend. If it doesn't match, switch the Cost Model to **CPC** and enter your CPM bid divided by 1,000 as the cost value. A popunder or interstitial impression is roughly one visit. On dynamic CPM your bid is a maximum, so expect ClickFlare to overstate spend slightly.

TwinRed doesn't sell on CPA, so the **CPA** cost model doesn't apply to TwinRed campaigns.

When the recorded spend differs from your TwinRed spend, correct it with a [manual cost upload](/docs/en/settings/manual-cost-upload.md). See [Cost Models](/docs/en/core-platform-concepts/cost-models.md).

## Delayed revenue

If you run search arbitrage (RSOC or AFD) behind TwinRed, the feed reports revenue hours or days after the click. To pass that revenue to TwinRed 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

> **TwinRed doesn't record the conversion**
>
> * The campaign URL in TwinRed is missing `transaction_id={transactionId}`, or the macro was edited. Copy the URL from ClickFlare again.
> * `REPLACE_WITH_TRACKER_ID` was never replaced with your tracker ID.
> * The postback still contains TwinRed's `INSERT_TRANSACTION_ID` instead of ClickFlare's `{external_id}`.
> * The tracker was deleted in **Manage Trackers**, so its ID no longer exists.

> **Conversions show in ClickFlare but not in TwinRed**
>
> * **Traffic source postback URL** is off on the TwinRed 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 TwinRed returned.

> **TwinRed shows conversions with no value**
>
> **Allow dynamic conversion value** is not ticked on the tracker, so TwinRed ignores `cv`. Tick it in **Manage Trackers**. Also check that `&cv={payout}` is still at the end of the postback.

> **Cost is far too high**
>
> The campaign is on CPM and `{cost}` carries the CPM price. Switch to **CPC** with your CPM bid divided by 1,000. See [Cost](#cost).

> **Source or site columns are empty**
>
> The macros were not replaced, usually because the URL was edited or pasted somewhere TwinRed doesn't process macros. 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:** Can I use the same TwinRed traffic source for all my TwinRed campaigns?

**A1:** Yes. The postback is set once on the traffic source and every campaign using it sends conversions the same way. A tracker belongs to your account, not to one campaign, so one tracker ID serves every campaign.

> **Q2:** Why is it called `transaction_id` in the campaign URL and `id` in the postback?

**A2:** They are two halves of the same value. ClickFlare reads TwinRed's transaction ID from its own `transaction_id` parameter. TwinRed expects it back in its own `id` parameter. Change neither.

> **Q3:** I found an older TwinRed setup with `s2sparam` and `twinrdsrv.com`. Which one is right?

**A3:** Use the template's. Older tracker guides show a legacy TwinRed postback with an `s2sparam` click ID. TwinRed's **Manage Trackers** page now gives postbacks on `ad.twinrdengine.com/conversion/`, which is what the template uses.

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

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

> **Q5:** Can I run CPA campaigns on TwinRed?

**A5:** No. TwinRed sells on CPM and CPC only. The postback still matters: it lets you measure your cost per action in TwinRed while you bid on CPM or CPC.

## 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)**
>
> Split leads and sales into separate events.

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