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

# Adsterra as a Traffic Source

> Track Adsterra campaigns in ClickFlare with the Adsterra template and send conversions with payout back to Adsterra by S2S postback.

![Adsterra traffic source template](https://mintcdn.com/clickflare/HqEKoSRx9HcBkY91/images/integrations/covers/templates/adsterra.png?fit=max\&auto=format\&n=HqEKoSRx9HcBkY91\&q=85\&s=cdc4be4d6abf7ea75efb7f4f57e5a95b)

Adsterra is a self-serve ad network selling popunder, Social Bar, in-page push, native and display banner traffic, most of it mobile. This guide sets up Adsterra as a traffic source in ClickFlare. It covers passing Adsterra's click data into your reports and sending conversions, with payout, back to Adsterra so its optimization and your stats agree.

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

## At a glance

| | |
| - | - |
| **Ad formats** | Popunder, Social Bar, in-page push, native banners, display banners |
| **Click ID macro** | `##SUB_ID_SHORT(action)##`, mandatory for conversion tracking |
| **Conversion tracking** | S2S postback to `pbterra.com` |
| **Payout passed back** | Yes, in the `atpay` parameter |
| **Multiple events** | Up to 3, one postback per event |
| **Cost** | Passed per click by the template, as Adsterra's price for the click (`##COST_CPC##`). Cost Model: **Not Tracked**. |
| **Conversion API** | No |

## How it works

**1. Adsterra sends the click**

A visitor clicks your ad. Adsterra opens your ClickFlare campaign URL and fills in its macros: the click ID in `subid`, the price of the click in `cost`, plus the zone, banner, placement, OS, country and other details.

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

ClickFlare saves the value of `subid` 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 Adsterra**

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

> [!NOTE]
>
> The mirror to keep straight: in the **campaign URL** you write *ClickFlare's* parameter (`subid`) and *Adsterra's* macro (`##SUB_ID_SHORT(action)##`). The template does this for you. In the **postback URL** you write *Adsterra's* parameter (`subid_short`) and *ClickFlare's* token (`{external_id}`).

## 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).
* **Know your Adsterra username.** It goes into the postback URL.
* **Decide which conversions Adsterra should receive.** Adsterra optimizes on what you send it. 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 Adsterra traffic source

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

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

| Name | TS Parameter | TS Token (Adsterra macro) | ClickFlare Token | What it carries |
| - | - | - | - | - |
| Cost | `cost` | `##COST_CPC##` | `{cost}` | Adsterra's price for the click. See [Cost](#cost). |
| external\_id | `subid` | `##SUB_ID_SHORT(action)##` | `{external_id}` | Adsterra's click ID. Required for the postback. |
| zoneid | `zoneid` | `##ZONE_ID##` | `{trackingField1}` | The publisher zone that showed the ad |
| device brand | `device_brand` | `##DEVICE_BRAND##` | `{trackingField2}` | The device brand, for example Samsung or Apple |
| bannerid | `bannerid` | `##BANNER_ID##` | `{trackingField3}` | The creative |
| os | `os` | `##USER_OS##` | `{trackingField4}` | The visitor's operating system |
| country | `country` | `##REMOTE_COUNTRY##` | `{trackingField5}` | The visitor's country |
| City | `city` | `##USER_CITY##` | `{trackingField6}` | The visitor's city |
| isp | `isp` | `##USER_CARRIER##` | `{trackingField7}` | The mobile carrier or ISP |
| useragent | `useragent` | `##USERAGENT##` | `{trackingField8}` | The full user agent |
| language | `language` | `##REMOTE_LANGUAGE##` | `{trackingField9}` | The browser language |
| placement | `placement` | `##PLACEMENT_ID##` | `{trackingField10}` | The placement inside the zone. Adsterra recommends it for placement-level stats. |

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

Each tracking field becomes a column you can group reports by. `zoneid` and `placement` are the ones you will use most: they tell you which publisher sites convert, so you can blacklist or bid up zones in Adsterra.

> [!WARNING]
>
> Don't change or remove the `external_id` row. Without `##SUB_ID_SHORT(action)##` in the campaign URL, Adsterra cannot match conversions, and its Conversion tracking page will warn that an obligatory token is missing.

To pass more Adsterra data, click **Add Parameter**, give it a name and parameter, and enter the Adsterra macro as the **TS Token**. ClickFlare assigns the next free tracking field. Check the macros your Adsterra account offers before adding them.

## Step 2 – Set up the postback

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

### Get your postback URL from Adsterra

1. In Adsterra, open the menu on the left and click **Conversion tracking**.
2. Choose **Custom** as the tracker. ClickFlare is not in Adsterra's list of built-in trackers.
3. Choose the postback type:

| Postback type | Use it when | URL format |
| - | - | - |
| Simple | You only want conversion counts | `http://www.pbterra.com/name/USERNAME/at?subid_short={clickid}` |
| With payout | Your payouts are in USD | `...?subid_short={clickid}&atpay={payout}` |
| With currency conversion | Your payouts are in another currency | `http://www.pbterra.com/code/EUR/USERNAME/at?subid_short={clickid}&atpay={payout}` |

4. Generate the postback and copy it. `USERNAME` is filled in with your Adsterra username.

Choose **With payout** unless you have a reason not to. Adsterra uses the payout for its CPA bidding and shows it in your Adsterra stats.

### 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}
http://www.pbterra.com/name/CHANGENAME/at?subid_short={external_id}&atpay={payout}
```

It already sends the click ID (`{external_id}`) and the payout (`{payout}`), both as ClickFlare tokens.

3. Replace `CHANGENAME` with your Adsterra username. Compare the result with the **With payout** URL you generated in Adsterra: apart from the click ID token (Adsterra's `{clickid}`, ClickFlare's `{external_id}`), the two should match. The result:

```text theme={null}
http://www.pbterra.com/name/USERNAME/at?subid_short={external_id}&atpay={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 Adsterra traffic source selected.

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

> [!WARNING]
>
> Replace `CHANGENAME` with your Adsterra username, exactly as it appears in the URL Adsterra generates. If `CHANGENAME` stays in the postback, Adsterra cannot match the conversions to your account.

Adsterra reads `atpay` as USD. If your offers pay in EUR or another currency, replace the template's URL with the **With currency conversion** URL from Adsterra, with your currency code in the path, so Adsterra converts it. Change its `{clickid}` to `{external_id}` and keep `{payout}`. 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** to **Not Tracked**, so ClickFlare uses the cost Adsterra passes. See [Cost](#cost).
3. Choose **Redirect** or **Direct** tracking. Redirect is the usual choice for Adsterra'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 Adsterra macro from the template, for example `subid=##SUB_ID_SHORT(action)##` and `zoneid=##ZONE_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 Adsterra.

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

## Step 4 – Create the campaign in Adsterra

1. In Adsterra, go to **Campaigns** and create a campaign.
2. Choose the ad format, targeting and bid as usual.
3. Paste the ClickFlare campaign URL into the campaign's URL field.
4. Submit the campaign for moderation.

Paste the URL exactly as ClickFlare gives it. Adsterra replaces each `##...##` macro when the ad is clicked.

## Step 5 – Test the integration

Adsterra can verify the setup before you spend anything.

1. In Adsterra, open **Conversion tracking** and paste your ClickFlare campaign URL into the URL check field.
2. Validate it. A correct URL returns *Your URL is correct. Go ahead and make a test conversion.* If Adsterra reports a missing token, check that the `subid=##SUB_ID_SHORT(action)##` part is in the URL.
3. Click **Make a test conversion** and complete the offer the way a real visitor would.
4. Check the status in Adsterra:

| Status | Meaning |
| - | - |
| **PENDING** | Adsterra has not received the postback yet. Wait 5–10 minutes, then click **Check status**. |
| **VALID** | The integration works. |
| **INVALID** | The postback arrived without a click ID Adsterra recognizes. Check `subid` in the campaign URL and `subid_short={external_id}` in the postback. |

5. In ClickFlare, go to **Logs → Postback Status** and filter by the campaign. A successful postback to `pbterra.com` confirms ClickFlare sent it.

***

## Tracking several events

Adsterra can track up to three conversion events per campaign, for example a registration, a deposit and a purchase. Each event needs its own postback, with an `event` parameter added:

```text theme={null}
http://www.pbterra.com/name/USERNAME/at?subid_short={external_id}&atpay={payout}&event=event1
http://www.pbterra.com/name/USERNAME/at?subid_short={external_id}&atpay={payout}&event=event2
```

1. In ClickFlare, create a [custom conversion](/docs/en/settings/custom-conversions.md) for each step, for example `lead` and `purchase`.
2. On the Adsterra traffic source, click **+ Another postback URL** once per extra event.
3. Map each postback to its ClickFlare event: the `lead` custom conversion to the `event=event1` URL, `purchase` to `event=event2`.
4. When you create the campaign in Adsterra, tick **I've set up events postback for this campaign**.
5. Test each event. Adsterra marks an event VALID only after you complete that action during the test.

> **Rules for multi-event postbacks**
>
> * Three events at most: `event1`, `event2`, `event3`.
> * One postback per event. Don't combine events in one URL.
> * Don't rename the events. Adsterra only reads `event1` to `event3`.
> * To optimize CPA bidding on a specific event, contact Adsterra support. They provide the postback URLs for paid-event optimization.
> * In Adsterra's **Statistics**, turn on **Multievents** to see conversions, eCPA and conversion rate split by event.

> **Sending only one event**
>
> If Adsterra 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 Adsterra.
>
> 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 per click. The `cost` row sends Adsterra's `##COST_CPC##` macro, which is Adsterra's price for the click, and 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.

> [!NOTE]
>
> `##COST_CPC##` reflects the price on CPC campaigns. On CPM campaigns, compare the **Cost** column with your Adsterra spend after launch. 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 Social Bar impression is roughly one visit.

For Adsterra's CPA goal campaigns, set the Cost Model to **CPA**, with your price per conversion.

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

> **Adsterra shows the test conversion as INVALID**
>
> * The campaign URL in Adsterra is missing `subid=##SUB_ID_SHORT(action)##`, or the macro was edited. Copy the URL from ClickFlare again.
> * The postback uses Adsterra's `{clickid}` instead of ClickFlare's `{external_id}`. ClickFlare doesn't know `{clickid}` and sends it as literal text.
> * The `external_id` row was removed from the traffic source.

> **Conversions show in ClickFlare but not in Adsterra**
>
> * **Traffic source postback URL** is off on the Adsterra 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.
> * `CHANGENAME` was never replaced with your Adsterra username.
> * Check **Logs → Postback Status**: a failed request shows the status code Adsterra returned.

> **Adsterra shows conversions with no payout**
>
> The template sends `atpay={payout}`, so it was removed or edited. Restore `&atpay={payout}` at the end of the postback.
>
> Also check that `CHANGENAME` was replaced with your Adsterra username. Adsterra can't credit a postback that still contains it.

> **Zone or placement columns are empty**
>
> The macros were not replaced, usually because the URL was pasted somewhere Adsterra doesn't process macros, or 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:** Can I use the same Adsterra traffic source for all my Adsterra 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 Adsterra traffic source only if a campaign needs a different postback, for example a different event setup.

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

**A2:** No. Choose **Custom**. The built-in options only pre-fill the click ID token for that tracker. With Custom you replace `{clickid}` with `{external_id}` yourself.

> **Q3:** Why is it called `subid` in the campaign URL and `subid_short` in the postback?

**A3:** They are two halves of the same value. ClickFlare reads Adsterra's click ID from its own `subid` parameter. Adsterra expects it back in its own `subid_short` parameter. Both names are fixed. Change neither.

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

**A4:** Redirect is the usual choice and works with every Adsterra format. Use Direct only if Adsterra 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 Adsterra's CPA campaigns?

**A5:** Yes. CPA campaigns need the postback, because Adsterra charges and optimizes on the conversions it receives. Set the campaign's cost model to **CPA** in ClickFlare.

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