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

# MediaGo as a Traffic Source

> Track MediaGo native ads in ClickFlare: pass the tracking ID, CPC and site macros, and post conversions with type and payout back to MediaGo.

![MediaGo traffic source template](https://mintcdn.com/clickflare/Z7FseNUODe2P_cAH/images/integrations/covers/templates/mediago.png?fit=max\&auto=format\&n=Z7FseNUODe2P_cAH\&q=85\&s=1da75215c6a5c7082690f228f772d8e6)

MediaGo is Baidu's native advertising platform. It places native ads on premium publisher sites worldwide, and you buy them on CPC. This guide sets up MediaGo as a traffic source in ClickFlare. It covers passing MediaGo's click data into your reports and sending conversions, with payout and conversion type, back to MediaGo so its optimization and your stats agree.

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

## At a glance

| | |
| - | - |
| **Ad formats** | Native ads on publisher sites |
| **Click ID macro** | `${TRACKING_ID}`, required for conversion tracking |
| **Conversion tracking** | S2S postback to `sync.mediago.io` |
| **Payout passed back** | Yes, in the `conversionprice` parameter |
| **Multiple events** | Yes. One postback per event, each with its own `conversiontype` |
| **Cost** | Passed per click by the template (`${CPC}`). Cost Model: **Not Tracked**. A cost integration is also available. |
| **Conversion API** | No |

## How it works

**1. MediaGo sends the click**

A visitor clicks your ad. MediaGo opens your landing page URL with your tracking string attached and fills in its macros: the tracking ID, the cost of the click, the ad, the asset, the site and other details.

**2. ClickFlare stores the MediaGo tracking ID**

ClickFlare saves the value of `TRACKING_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 MediaGo**

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

> [!NOTE]
>
> The mirror to keep straight: in the **campaign URL** you write *ClickFlare's* parameter (`TRACKING_ID`) and *MediaGo's* macro (`${TRACKING_ID}`). The template does this for you. In the **postback URL** you write *MediaGo's* parameter (`trackingid`) 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 MediaGo account name.** It goes into the postback, so MediaGo support can find your requests in their logs.
* **Decide which conversion type MediaGo should count.** MediaGo labels each conversion with a type (purchase, lead, registration...) and decides from a flag whether it counts in the main **Conversions** column. If your funnel has several steps, decide now which one is final. See [Tracking several events](#tracking-several-events).

***

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

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

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

| Name | TS Parameter | TS Token (MediaGo macro) | ClickFlare Token | What it carries |
| - | - | - | - | - |
| Cost | `CPC` | `${CPC}` | `{cost}` | The cost of the click. See [Cost](#cost). |
| External ID | `TRACKING_ID` | `${TRACKING_ID}` | `{external_id}` | MediaGo's tracking ID for the click. Required for the postback. |
| AD\_ID | `AD_ID` | `${AD_ID}` | `{trackingField1}` | The MediaGo ad ID. Also sent back in the postback. |
| AD\_TITLE | `AD_TITLE` | `${AD_TITLE}` | `{trackingField2}` | The ad's title |
| ASSET\_ID | `ASSET_ID` | `${ASSET_ID}` | `{trackingField3}` | The asset: one unique combination of URL, image and title |
| AD\_ASSET\_NAME | `AD_ASSET_NAME` | `${AD_ASSET_NAME}` | `{trackingField4}` | The original file name of the image or video |
| CAMPAIGN\_ID | `CAMPAIGN_ID` | `${CAMPAIGN_ID}` | `{trackingField5}` | The MediaGo campaign ID |
| BID\_TIME\_STAMP | `BID_TIME_STAMP` | `${BID_TIME_STAMP}` | `{trackingField6}` | When the ad was served. In UTC+8, not UTC. |
| PLATFORM | `PLATFORM` | `${PLATFORM}` | `{trackingField7}` | The device the ad was seen on |
| PUBLISHER\_NAME | `PUBLISHER_NAME` | `${PUBLISHER_NAME}` | `{trackingField8}` | The publisher, for example `www.msn.com` |
| SITE\_ID | `SITE_ID` | `${SITE_ID}` | `{trackingField9}` | MediaGo's ID for the site |
| CONTENT\_NAME | `CONTENT_NAME` | `${CONTENT_NAME}` | `{trackingField10}` | The content category of the page the ad ran on |

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

Each tracking field becomes a column you can group reports by. `SITE_ID` and `PUBLISHER_NAME` show which placements convert, so you can block or bid on sites in MediaGo. `AD_ID` and `ASSET_ID` show which creatives work.

> [!WARNING]
>
> Don't change or remove the External ID row. Without `${TRACKING_ID}` in the URL, MediaGo cannot match conversions. Also keep the AD\_ID row on `{trackingField1}`: the template's postback reads the ad ID from that field.

To pass more MediaGo data, click **Add Parameter**, give it a name and parameter, and enter the MediaGo macro as the **TS Token**. ClickFlare assigns the next free tracking field. MediaGo also offers `${CAMPAIGN_NAME}`, which the template leaves out.

## Step 2 – Set up the postback

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

### What MediaGo's postback expects

MediaGo documents one postback endpoint with these parameters:

| Parameter | Required | What to send |
| - | - | - |
| `trackingid` | Yes | The tracking ID from the click. Without it, the conversion is not tracked. |
| `adid` | Recommended | The ad ID from the click |
| `conversiontype` | Recommended | A number for the type of conversion. See the table below. Defaults to `1` (View Content). |
| `conversionprice` | Recommended | The revenue, used for ROAS. Any whole or decimal number, no commas. |
| `includeintotalconversion` | Recommended | `1` to count it in the dashboard's **Conversions** column, `0` for an intermediate step. Defaults to `1`. |
| `accountname` | Recommended | Your MediaGo account name, to help MediaGo support trace problems |

MediaGo's conversion types:

| Type | Value | Type | Value |
| - | - | - | - |
| View Content | `1` | Lead | `10` |
| App Install | `2` | Click Button | `12` |
| Complete Registration | `3` | Lead Qualified | `13` |
| Add to Cart | `4` | Call Connected | `14` |
| Add Payment Info | `5` | Appointment Booked | `15` |
| Search | `6` | Application Started | `16` |
| Start Checkout | `7` | Application Approved | `17` |
| Purchase | `8` | Account Created | `18` |
| Add to Wishlist | `9` | Deal Completed | `19` |

### 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://sync.mediago.io/api/bidder/postback?trackingid={external_id}&adid={trackingField1}&conversiontype=REPLACE&conversionprice={payout}&includeintotalconversion=REPLACE&accountname=REPLACE
```

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

It already sends the tracking ID (`{external_id}`), the ad ID (`{trackingField1}`) and the payout (`{payout}`), all as ClickFlare tokens.

3. Replace the three `REPLACE` values:

   * `conversiontype=REPLACE`: the number for your conversion, for example `8` for Purchase or `10` for Lead.
   * `includeintotalconversion=REPLACE`: `1` for your final conversion.
   * `accountname=REPLACE`: your MediaGo account name.

   For a purchase, the result looks like this:

```text theme={null}
https://sync.mediago.io/api/bidder/postback?trackingid={external_id}&adid={trackingField1}&conversiontype=8&conversionprice={payout}&includeintotalconversion=1&accountname=your_account_name
```

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 MediaGo traffic source selected.

> [!WARNING]
>
> Replace all three `REPLACE` values. MediaGo expects a number in `conversiontype` and `0` or `1` in `includeintotalconversion`. A postback that still carries `REPLACE` sends invalid values, and the conversion may be dropped or filed under the wrong type.

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 MediaGo passes. See [Cost](#cost).
3. Choose **Redirect** or **Direct** tracking. Redirect is the usual choice for MediaGo.
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 MediaGo macro from the template, for example `TRACKING_ID=${TRACKING_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 MediaGo.

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

## Step 4 – Create the campaign in MediaGo

MediaGo takes the URL in two parts. Its **Tracking** field cannot contain `?`, `@`, `#`, `/`, spaces or line breaks, so you split the ClickFlare campaign URL at the `?`.

1. In MediaGo, click **Create Ad** in the navigation bar and set up the campaign as usual.
2. In the **Landing page URL** field, paste the part of the ClickFlare campaign URL **before** the `?`.
3. On the **Create Ad Set** page, scroll to the **Tracking** field at the bottom and paste the part **after** the `?`. Don't include the `?` itself.
4. Save the campaign and submit it for review.

The first part is your tracking domain and the campaign's path. The second part is the list of parameters, such as `CPC=${CPC}` and `TRACKING_ID=${TRACKING_ID}`, joined by `&`. Check that the tracking string still contains `TRACKING_ID=${TRACKING_ID}` after pasting.

MediaGo adds the tracking string to the landing page URL and replaces each `${...}` macro when the ad is clicked.

## Step 5 – Test the integration

1. Once the ad is live, click it yourself and look at the URL that opens. No `${...}` text should remain, and `TRACKING_ID` should hold a long alphanumeric value.
2. In ClickFlare, check that the visit shows up in the campaign with the cost and tracking fields filled.
3. Complete the offer the way a real visitor would.
4. In ClickFlare, go to **Logs → Postback Status** and filter by the campaign. Open the postback to `sync.mediago.io` and check that `trackingid` holds the tracking ID, and that `conversiontype`, `includeintotalconversion` and `accountname` hold your values, not `REPLACE`.
5. In MediaGo, check that the conversion appears in the dashboard under the expected conversion type, and in the total if you sent `1`.

If you use a lander, test the whole path. The tracking ID can be lost at any redirect between the ad and the offer.

***

## Tracking several events

MediaGo can record several funnel steps, for example a lead and a purchase. Each step needs its own postback with its own `conversiontype`. Send intermediate steps with `includeintotalconversion=0` and only the final step with `1`. Otherwise every step counts as a conversion in MediaGo and your conversion rate is inflated.

```text theme={null}
https://sync.mediago.io/api/bidder/postback?trackingid={external_id}&adid={trackingField1}&conversiontype=10&conversionprice={payout}&includeintotalconversion=0&accountname=your_account_name
https://sync.mediago.io/api/bidder/postback?trackingid={external_id}&adid={trackingField1}&conversiontype=8&conversionprice={payout}&includeintotalconversion=1&accountname=your_account_name
```

1. In ClickFlare, create a [custom conversion](/docs/en/settings/custom-conversions.md) for each step, for example `lead` and `purchase`.
2. On the MediaGo traffic source, click **+ Another postback URL** once per extra event.
3. Map each postback to its ClickFlare event: `lead` to the `conversiontype=10` URL, `purchase` to the `conversiontype=8` URL.
4. Test each event and check it in **Logs → Postback Status**.

> **Rules for multi-event postbacks**
>
> * One postback per event. Don't combine types in one URL.
> * Use the numbers from MediaGo's conversion type table. Other values are not documented.
> * Only the final step gets `includeintotalconversion=1`. Intermediate steps still show in their own conversion type column.
> * Keep `trackingid={external_id}` in every postback.

> **Sending only one event**
>
> If MediaGo 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 MediaGo.
>
> 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 MediaGo's `${CPC}` macro, the CPC of the ad, 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.

For exact spend, add ClickFlare's **MediaGo cost integration**. It pulls cost from MediaGo's API every hour. You need a MediaGo API token, which you request from your MediaGo account manager or support. Once the integration exists, select it under **Cost Integration** on the MediaGo traffic source, and set the integration's timezone to match your MediaGo account. See [MediaGo Cost Integration](/docs/en/integrations/media-go.md).

> [!NOTE]
>
> Don't create several cost integrations with the same MediaGo API token. Parallel requests can hit MediaGo's API rate limit.

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

> **MediaGo doesn't record the conversion**
>
> * The tracking string in MediaGo's **Tracking** field is missing `TRACKING_ID=${TRACKING_ID}`, or the macro was edited. Copy it from the ClickFlare campaign URL again.
> * The postback uses MediaGo's `${TRACKING_ID}` instead of ClickFlare's `{external_id}`. MediaGo's macros only work in the click URL, not in the postback.
> * The External ID row was removed from the traffic source.
> * A `REPLACE` value is still in the postback.

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

> **Conversions appear under a type column but not in the total**
>
> The postback sends `includeintotalconversion=0`. Change it to `1` for your final conversion.

> **MediaGo rejects the tracking string, or macros stay unreplaced**
>
> * The **Tracking** field contains a `?`, `/`, `#`, `@` or space. Paste only the part of the campaign URL after the `?`, and put the rest in **Landing page URL**.
> * The URL was edited after copying. Paste it from ClickFlare unchanged. See [Traffic Source Tokens Arriving Empty](/docs/en/troubleshooting/tokens-arriving-empty.md).

> **Times in the BID\_TIME\_STAMP column look off**
>
> `${BID_TIME_STAMP}` is in UTC+8. Convert it before comparing with ClickFlare's visit times.

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

***

**FREQUENTLY ASKED QUESTIONS**

> **Q1:** Can I use the same MediaGo traffic source for all my MediaGo 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 MediaGo traffic source only if a campaign needs a different postback, for example a different conversion type.

> **Q2:** Why is it `TRACKING_ID` in the campaign URL and `trackingid` in the postback?

**A2:** They are two halves of the same value. ClickFlare reads MediaGo's tracking ID from its own `TRACKING_ID` parameter. MediaGo expects it back in its own `trackingid` parameter. Change neither.

> **Q3:** Do I need both the `${CPC}` macro and the cost integration?

**A3:** No. The macro gives you cost per click as soon as traffic starts. The integration pulls spend from MediaGo's API every hour and is the more exact of the two. Use the integration if you can.

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

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

> **Q5:** What if I leave `accountname` out?

**A5:** MediaGo marks it as recommended, not required. The conversion still counts. MediaGo support uses it to find your requests in their logs, so keep it if you can.

## Related

> **[MediaGo cost integration](/docs/en/integrations/media-go.md)**
>
> Pull your MediaGo spend into ClickFlare automatically.

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

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