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

# TrafficStars as a Traffic Source

> Track TrafficStars campaigns in ClickFlare: capture the click ID and spot macros, and post conversions with revenue back via S2S postback.

![TrafficStars traffic source template](https://mintcdn.com/clickflare/oNlhH4HxR5JFsOiP/images/integrations/covers/templates/trafficstars.png?fit=max\&auto=format\&n=oNlhH4HxR5JFsOiP\&q=85\&s=4093ca83306857bc6429070da4b3df14)

TrafficStars is a self-serve ad network selling popunder, push, native, banner and video traffic, bought on CPM, CPC or CPA. This guide sets up TrafficStars as a traffic source in ClickFlare. It covers passing TrafficStars' click data into your reports and sending conversions, with revenue, back to TrafficStars so its optimization and your stats agree.

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

## At a glance

| | |
| - | - |
| **Ad formats** | Popunder, push, native, banners, video |
| **Click ID macro** | `{click_id}`, mandatory for conversion tracking |
| **Conversion tracking** | S2S postback to `tsyndicate.com` |
| **Revenue passed back** | Yes. The template sends `{payout}` in the `value` parameter. |
| **What you replace** | `REPLACE` in the postback, with your TrafficStars key |
| **Multiple events** | Yes, with goals, or with `lead_code` for several conversions per click |
| **Cost** | Passed per click by the template, as the amount actually paid (`{cost}`) |
| **Conversion API** | No |

## How it works

**1. TrafficStars sends the click**

A visitor clicks your ad. TrafficStars opens your ClickFlare campaign URL and fills in its macros: the click ID in `externalid`, the price paid in `cost`, plus the site, ad spot, format, OS, browser and other details.

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

ClickFlare saves the value of `externalid` 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 TrafficStars**

ClickFlare fires the TrafficStars postback, replacing `{external_id}` with the stored TrafficStars click ID and `{payout}` with the revenue. TrafficStars matches it to the original click.

> [!NOTE]
>
> The mirror to keep straight: in the **campaign URL** you write *ClickFlare's* parameter (`externalid`) and *TrafficStars'* macro (`{click_id}`). The template does this for you. In the **postback URL** you write *TrafficStars'* slot for the click ID (the URL path after `/action/`) and *ClickFlare's* token (`{external_id}`). The template does this too. Both platforms use curly braces, so check which side of the mirror you are on before you paste.

## 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).
* **Get your TrafficStars key.** The postback needs the key that identifies your advertiser account. You find it in Step 2.
* **Decide which conversions TrafficStars should receive.** TrafficStars optimizes on what you send it, and CPA campaigns are charged per conversion it receives. 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 TrafficStars traffic source

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

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

| Name | TS Parameter | TS Token (TrafficStars macro) | ClickFlare Token | What it carries |
| - | - | - | - | - |
| cost | `cost` | `{cost}` | `{cost}` | The amount actually paid for the click. See [Cost](#cost). |
| externalId | `externalid` | `{click_id}` | `{external_id}` | TrafficStars' click ID. Required for the postback. |
| Device type | `device_type` | `{device_type}` | `{trackingField1}` | The visitor's device type |
| OS | `os` | `{os}` | `{trackingField2}` | The visitor's operating system |
| Browser | `browser` | `{browser}` | `{trackingField3}` | The visitor's browser |
| Site ID | `site_id` | `{site_id}` | `{trackingField4}` | The publisher site that showed the ad |
| Site URL | `site_host` | `{site_host}` | `{trackingField5}` | The publisher site's host name |
| Carrier | `carrier` | `{carrier}` | `{trackingField6}` | The mobile carrier |
| Format | `format` | `{format}` | `{trackingField7}` | The creative format: a size such as `300x250` for banners, or a name such as `Popunder` or `Native` |
| Ad spot ID | `adspot_id` | `{adspot_id}` | `{trackingField8}` | The ad spot (placement) on the site |
| Ad spot name | `adspot_name` | `{adspot_name}` | `{trackingField9}` | The ad spot's name |
| Keywords | `keywords` | `{keywords}` | `{trackingField10}` | Keywords TrafficStars collected for the impression |

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

Each tracking field becomes a column you can group reports by. `site_id` and `adspot_id` are the ones you will use most: they tell you which sites and spots convert, so you can block or bid up spots in TrafficStars.

> [!WARNING]
>
> Don't change or remove the `externalId` row. Without `{click_id}` in the campaign URL, TrafficStars cannot match conversions. TrafficStars only shows its S2S test button when the URL contains the `click_id` macro.

To pass more TrafficStars data, click **Add Parameter**, give it a name and parameter, and enter the TrafficStars macro as the **TS Token**. ClickFlare assigns the next free tracking field. Useful extras from TrafficStars' token list: `{campaign_id}`, `{creative_id}`, `{geo}` (2-letter country code), `{category}` and `{pricing_model}`.

## Step 2 – Set up the postback

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

### Add the template's postback 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://tsyndicate.com/api/v1/cpa/action/{external_id}?value={payout}&key=REPLACE
```

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

It already has everything except your key:

| Part | Filled by | What it carries |
| - | - | - |
| `/action/{external_id}` | ClickFlare | TrafficStars' click ID, stored from `externalid` when the visitor arrived |
| `value={payout}` | ClickFlare | Your revenue from the conversion |
| `key=REPLACE` | You | Your TrafficStars key. Replace it in the next step. |

3. Replace `REPLACE` with your TrafficStars key. See [Find your key in TrafficStars](#find-your-key-in-trafficstars) below.
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 TrafficStars traffic source selected.

> [!WARNING]
>
> Replace `REPLACE` with the key itself, without adding curly braces. If your key is `abc123`, the end of the URL reads `key=abc123`, not `key={abc123}`. ClickFlare treats anything in curly braces as a token, sends an unknown token empty or as literal text, and TrafficStars then rejects the postback.

### Find your key in TrafficStars

1. In TrafficStars, open **Tracking Tools** and go to the postback page. Older TrafficStars guides call this tab **Goals & Postbacks**.
2. Choose a custom tracking service. ClickFlare is not in TrafficStars' list of integrated trackers.
3. Name it and click **Generate**.
4. In the generated URL, copy the value after `key=`. That is the value that goes in place of `REPLACE`.

The generated URL points to `https://tsyndicate.com/api/v1/cpa/action` too. You only need its key: the ClickFlare template already carries the click ID and the revenue. The postback page also lists these options:

| Option | Parameter | What it does |
| - | - | - |
| Track earnings and ROI | `value` | Reports your revenue from the conversion. The template already sends it. |
| Report conversion cost | `price` | Reports what the conversion cost you, for CPA campaigns |
| Track post-conversion events | `lead_code` | A unique ID per conversion, so one click can report several conversions. Optional. See below. |
| Allow duplicates | `allow_duplicates=1` | Records duplicate conversions instead of dropping them |

You don't need `lead_code` for one conversion per click, which is how most campaigns run. Add it only to report several conversions from the same click, as described in [Tracking several events](#tracking-several-events).

Leave `price` out unless you need it. TrafficStars charges the CPA you set on a CPA campaign for each conversion, unless a different amount arrives in the postback. If you add `price`, fill it with the amount you agreed to pay per conversion, never with `{payout}`.

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**. See [Cost](#cost).
3. Choose **Redirect** or **Direct** tracking. Redirect is the usual choice for TrafficStars' popunder, push 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 TrafficStars macro from the template, for example `externalid={click_id}` and `site_id={site_id}`.

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

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

## Step 4 – Create the campaign in TrafficStars

1. In TrafficStars, create a campaign.
2. Choose the ad format, pricing model, targeting and bid as usual.
3. Paste the ClickFlare campaign URL as the ad's URL. TrafficStars asks for it on the last page of the campaign settings.
4. Publish the campaign and wait for approval.

Paste the URL exactly as ClickFlare gives it. TrafficStars replaces each `{...}` macro when the ad is clicked. Don't add `{click_id}` a second time under another name: the template already sends it in `externalid`.

## Step 5 – Test the integration

TrafficStars has an S2S test page for checking the postback before you spend anything.

1. Open the S2S test page, either from **Tracking Tools** or from Step 3 of the campaign creation page. The test button only appears if the URL contains the `click_id` macro.
2. Paste your ClickFlare campaign URL.
3. Follow the link and complete the offer the way a real visitor would. Or use your affiliate network's own S2S test tool to send a test conversion.
4. Click **Check Status**. The status should be **OK**. Click **Update** to refresh it after a resend, and **Regenerate** to clear the test and start again.
5. In ClickFlare, go to **Logs → Postback Status** and filter by the campaign. A successful request to `tsyndicate.com` confirms ClickFlare sent it.

> **Testing with TrafficStars' test click API**
>
> TrafficStars also has a test click API that generates a click code for a campaign without a real impression:
>
> ```text theme={null}
> http://tsyndicate.com/api/v1/ad/testclick/?campaign=YOUR_CAMPAIGN_ID
> ```
>
> It returns a `code` and a `callback` URL. Open your ClickFlare campaign URL with that code as the `externalid` value, complete the offer, and check that ClickFlare's postback reaches TrafficStars with the same code.

***

## Tracking several events

TrafficStars separates conversion types with **goals**, for example a registration, a purchase or an install. Each goal has its own postback URL. The `key` is the same for every goal.

1. In TrafficStars, create a goal for each step and generate a postback for each one.
2. In ClickFlare, create a [custom conversion](/docs/en/settings/custom-conversions.md) for each step, for example `lead` and `purchase`.
3. On the TrafficStars traffic source, click **+ Another postback URL** once per extra goal.
4. Map each postback to its ClickFlare event: the `lead` custom conversion to the registration goal's URL, `purchase` to the purchase goal's URL. In each URL TrafficStars generates, replace `{click_id}` with `{external_id}` and `{value}` with `{payout}`.
5. Test each goal.

> **Several conversions from one click**
>
> By default TrafficStars counts one conversion per click. To report several, for example repeat deposits, tick **Track post-conversion events** and add `&lead_code={txid}` to the postback. `{txid}` is the conversion's transaction ID, so each conversion reaches TrafficStars with its own code. Your affiliate network must send a transaction ID to ClickFlare for this to work.
>
> Tick **Allow duplicates** only if TrafficStars should record repeated postbacks for the same conversion.

> **Sending only one event**
>
> If TrafficStars should only learn from your final sale, keep a single postback and map it to that event. Earlier steps (leads, add to carts) still show in ClickFlare. They just don't reach TrafficStars.
>
> 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.

> **Payout modifier on CPA campaigns**
>
> If you send TrafficStars the full payout you receive from your affiliate network, TrafficStars' **Payout modifier** adjusts it so the ROI in TrafficStars matches your real margin. Set it in TrafficStars, on the CPA campaign.

## Cost

The template passes cost per click. The `cost` row sends TrafficStars' `{cost}` macro, which is **the amount actually paid**, and ClickFlare records it as the visit's cost.

TrafficStars fills `{cost}` on CPC, CPA and DCPM (popunder only) pricing.

On the campaign, set the **Cost Model** to **Not Tracked** so ClickFlare uses the cost passed in the URL. If you buy on another pricing model, such as plain CPM, check the **Cost** column after launch. If it is empty, switch to a **CPC** cost model and enter your per-visit price instead.

When the recorded spend differs from your TrafficStars invoice, 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 TrafficStars, the feed reports revenue hours or days after the click. To pass that revenue to TrafficStars 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

> **TrafficStars' S2S test doesn't show OK**
>
> * The campaign URL in TrafficStars is missing `externalid={click_id}`, or the macro was edited. Copy the URL from ClickFlare again.
> * The postback still uses TrafficStars' `{click_id}` instead of ClickFlare's `{external_id}`. ClickFlare doesn't know `{click_id}` and sends it as literal text.
> * The `key` in the postback is missing or belongs to another TrafficStars account.
> * The postback still ends in `key=REPLACE`, or the key was wrapped in curly braces (`key={abc123}`). It must read `key=abc123`.
> * The `externalId` row was removed from the traffic source.

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

> **Cost in ClickFlare is empty or doesn't match TrafficStars**
>
> The `cost` row sends `{cost}`, the amount actually paid. TrafficStars fills it on CPC, CPA and popunder DCPM pricing. On other pricing models, such as plain CPM, it can arrive empty: switch to a **CPC** cost model with your per-visit price. If the totals still differ from your TrafficStars spend, correct them with a [manual cost upload](/docs/en/settings/manual-cost-upload.md).

> **Site or ad spot columns are empty**
>
> The macros were not replaced, usually because the URL was edited or pasted somewhere TrafficStars 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 TrafficStars traffic source for all my TrafficStars campaigns?

**A1:** Yes. The postback is set once on the traffic source and every campaign using it sends conversions the same way. Create a second TrafficStars traffic source only if a campaign needs a different postback, for example a different goal setup.

> **Q2:** TrafficStars lists Voluum, Binom, RedTrack and other trackers, but not ClickFlare. Is that a problem?

**A2:** No. The ClickFlare template already has the postback in TrafficStars' format, with ClickFlare's tokens in place. You only take your key from TrafficStars. When you generate a postback there, choose a custom tracking service.

> **Q3:** Why is it `externalid` in the campaign URL but not in the postback?

**A3:** They are two halves of the same value. ClickFlare reads TrafficStars' click ID from its own `externalid` parameter. TrafficStars expects it back in the URL path, after `/action/`, as the template sends it. TrafficStars' own generated URLs use a `clickid` parameter instead. Change neither.

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

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

> **Q5:** Does the template work for TrafficStars' CPA campaigns?

**A5:** Yes, once your key is in the postback. CPA campaigns need the postback, because TrafficStars charges and optimizes on the conversions it receives. Set the campaign's cost model to **CPA** in ClickFlare, with your CPA as the value.

## 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 URL-passed 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.