Skip to main content
MGID traffic source template MGID is a native advertising network. It shows your ads (MGID calls them teasers) in recommendation widgets on publisher sites worldwide. This guide sets up MGID as a traffic source in ClickFlare. It covers passing MGID’s click data and cost into your reports and sending conversions, with revenue, back to MGID so its optimization and your stats agree. You do everything from the campaign editor. The MGID traffic source is created inline, without leaving the campaign.

At a glance

How it works

1

MGID sends the click

A visitor clicks your teaser. MGID opens your ClickFlare campaign URL and fills in its macros: the click ID in click_id, the click price in click_price, plus the teaser, widget, campaign and other details.
2

ClickFlare stores the MGID click ID

ClickFlare saves the value of click_id as the visit’s External ID, records the click price as the visit’s cost, and redirects the visitor to your lander or offer.
3

The conversion reaches ClickFlare

Your affiliate network, store or feed posts the conversion back to ClickFlare, matched on the ClickFlare click ID.
4

ClickFlare posts it back to MGID

ClickFlare fires the MGID postback, replacing {external_id} with the stored MGID click ID and {payout} with the revenue. MGID matches it to the original click and records it under the goal named in e.
The mirror to keep straight: in the campaign URL you write ClickFlare’s parameter (click_id) and MGID’s macro ({click_id}). The template does this for you. In the postback URL you write MGID’s parameter (c) 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.
  • Have an offer ready in ClickFlare, and its affiliate network set up to post conversions back to ClickFlare. See Creating an Offer and Adding an Affiliate Network.
  • Plan your MGID conversion goals. MGID allows up to three per campaign: a main goal and two additional ones. Goal names may contain only Latin letters and numbers, for example purchase or lead1. No spaces, underscores or dashes.
  • Decide which conversions MGID should receive. MGID optimizes on what you send it. See Tracking several events.

Step 1 – Create the campaign and the MGID traffic source

  1. Go to Campaigns and click New.
  2. In Traffic Source, open the dropdown and click + New Traffic Source.
  3. Type mgid in the search box and select the MGID template.
  4. Enter a Name, for example MGID.
  5. Set Cost currency to the currency of your MGID account. The click price arrives in that currency.
The template fills in the Parameters table for you: The MGID template's Parameters table in ClickFlare, with MGID's macros pre-filled Each tracking field becomes a column you can group reports by. widget_id is the one you will use most: it tells you which publisher placements convert, so you can block them or adjust their bids in MGID. teaser_id and title tell you which creative won. For the visitor’s real country, use ClickFlare’s own geo data, not the geo column. MGID’s {geo} repeats your campaign targeting.
Don’t change or remove the externalId row. Without {click_id} in the campaign URL, ClickFlare has no MGID click ID to send back, and MGID cannot attribute any conversion.
To pass more MGID data, click Add Parameter, give it a name and parameter, and enter the MGID macro as the TS Token. ClickFlare assigns the next free tracking field. MGID also offers {source}, {source_id}, {site_id}, {site_category} and {geo_region}, among others. Check MGID’s macro list before adding them.

Step 2 – Set up the postback

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

Get your client ID and goal name from MGID

The template’s postback needs two values from MGID: your client ID and the name of the conversion goal. MGID shows both in the postback URL it creates inside each campaign’s conversion tracking settings.
  1. In MGID, create a campaign, or open an existing one and click its edit icon.
  2. Go to the Conversion tracking section and, on the Tracking settings tab, choose Postback.
  3. Add your conversion goal and give it a name, for example purchase. Add up to two more goals if you track several events.
  4. Optional: under the advanced settings, choose whether each goal counts unique or non-unique conversions. Unique is the default.
  5. In the Postback URLs section, click Get Postback URL next to the goal and copy it.
The URL MGID gives you has this shape:
Note two values from it: the client ID after /postback/, and the goal name in e. You only need these two. The ClickFlare template already has the click ID and revenue tokens in place. Keep the MGID tab open. You come back to it in Step 4.

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:
  1. Replace the two placeholders:
Leave {external_id} and {payout} as they are. ClickFlare fills them in. With client ID 12345 and the goal purchase, the result is:
  1. 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.
  2. Click Save. You are back in the campaign editor with the MGID traffic source selected.
The Traffic source postback URL switched on, showing the MGID template's postback Only c and e are mandatory. r is optional, but without it MGID doesn’t know your revenue. MGID shows revenue in your account’s currency, so send payouts in that currency. See Multicurrency in ClickFlare. To learn what each postback token does, see How to Configure a Traffic Source S2S Postback URL.

Step 3 – Finish the campaign and copy its URL

  1. Name the campaign.
  2. Set the Cost Model. See Cost.
  3. Choose Redirect or Direct tracking. Redirect is the usual choice.
  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 MGID macro from the template, for example click_id={click_id} and click_price={click_price}. 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 MGID. See Creating a Campaign in ClickFlare.

Step 4 – Create the campaign in MGID

  1. Return to the MGID campaign from Step 2 and finish its targeting, budget and bid.
  2. In the tracking link settings, make sure click_id={click_id} appears only once. The ClickFlare URL already carries it. Check the Tracking link preview to see the final link.
  3. Click Publish.
  4. Create your ads and paste the ClickFlare campaign URL into each ad’s URL field.
Paste the URL exactly as ClickFlare gives it. MGID replaces each macro in curly braces when the ad is clicked. MGID also adds any macros you selected in its Tracking Tags block. Keep those from duplicating the ClickFlare parameters.

Step 5 – Test the integration

MGID records test conversions separately from real ones.
  1. In MGID, open the campaign’s ads. Hover over an ad image and click the eye icon to open the preview.
  2. Click the ad in the preview and complete the offer the way a real visitor would. Clicks from the preview are flagged as tests.
  3. In ClickFlare, check the visit. The External ID should hold an MGID click ID, not the literal text {click_id}.
  4. Go to Logs → Postback Status and filter by the campaign. A successful request to a.mgid.com confirms ClickFlare sent the postback.
  5. In MGID, wait 5–15 minutes and check the Test conversions column in the campaign list. If it is missing, add it with Columns. It can take up to an hour.
The test conversion appears under the goal it was sent for: the main goal or one of the two additional goals.

Tracking several events

MGID tracks up to three goals per campaign, for example a lead, a deposit and a purchase. Each goal has its own postback, with its own name in e:
  1. In MGID, add a goal for each step. Note each goal’s name.
  2. In ClickFlare, create a custom conversion for each step, for example lead and purchase.
  3. On the MGID traffic source, click + Another postback URL once per extra goal.
  4. In each postback, paste the template’s URL, replace YOUR_CLIENT_ID with your client ID and REPLACE_EVENT_NAME with that goal’s name. Map each postback to its ClickFlare event: the lead custom conversion to the e=lead URL, purchase to e=purchase.
  5. Test each goal. MGID shows test conversions under each goal separately.
  • Three goals at most: a main goal and two additional ones.
  • One postback per goal. Don’t combine goals in one URL.
  • Goal names use Latin letters and numbers only, and each name is unique.
  • The e value must match the goal name in MGID exactly.
  • Choose unique or non-unique counting separately for each goal.
If MGID 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 MGID.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. MGID fills {click_price} with the price of each click, and ClickFlare stores it as the visit’s cost. In the campaign editor, set the Cost Model to Not Tracked. With no cost integration connected, ClickFlare then takes the cost from the click_price value in the URL. A fixed CPC would ignore MGID’s real bid. See Cost Models. {click_price} is an estimate. MGID notes that some clicks are discounted after the fact and never charged, so the URL can overstate your spend. MGID recommends its API for actual figures. For exact spend, use ClickFlare’s MGID cost integration. It pulls cost from MGID’s API at campaign, content and publisher level. You need your MGID email, password, Client API ID and access token. Once the integration exists, select it under Cost Integration on the MGID traffic source and keep the campaign’s Cost Model on Not Tracked. The integration then takes priority over the URL value. Set the integration’s timezone to match your MGID account, or costs will drift between days. See MGID Cost Integration. To fix individual days by hand, use a manual cost upload. See also Traffic Source Cost Tracking.

Delayed revenue

If you run search arbitrage (RSOC or AFD) behind MGID, the feed reports revenue hours or days after the click. To pass that revenue to MGID once it arrives, see Sending Delayed Revenue to Traffic Sources.

Troubleshooting

  • YOUR_CLIENT_ID is still in the postback, or the client ID belongs to another MGID account. Copy it from MGID’s Get Postback URL.
  • REPLACE_EVENT_NAME is still in the postback, or e doesn’t match the goal name in MGID exactly.
  • The postback still uses MGID’s {click_id} instead of ClickFlare’s {external_id}. ClickFlare doesn’t know {click_id} and sends it as literal text.
  • The test click wasn’t made from the ad preview, so MGID didn’t flag it as a test.
  • Traffic source postback URL is off on the MGID 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 MGID returned.
The postback has no r={payout}, or r still holds MGID’s {revenue}. Use ClickFlare’s {payout}.
{click_price} doesn’t account for clicks MGID discounts later. Connect the MGID cost integration and match its timezone to your MGID account.
The macros were not replaced, usually because the URL was edited or a parameter was duplicated by MGID’s Tracking Tags. Paste the campaign URL from ClickFlare unchanged. See Traffic Source Tokens Arriving Empty.
For the general checklist, see Conversions not showing.
FREQUENTLY ASKED QUESTIONS
Q1: Can I use the same MGID traffic source for all my MGID campaigns?
A1: Yes, if they use the same goal names. The postback is set once on the traffic source and every campaign using it sends conversions the same way. Create a second MGID traffic source only if a campaign needs different goals.
Q2: Why is it called click_id in the campaign URL and c in the postback?
A2: They are two halves of the same value. ClickFlare reads MGID’s click ID from its own click_id parameter. MGID expects it back in its own c parameter. Both names are fixed. Change neither.
Q3: Can I rename my MGID goals later?
A3: Yes, but update the e value in the ClickFlare postback at the same time. A postback with an old goal name no longer matches.
Q4: Should I use Redirect or Direct tracking with MGID?
A4: Redirect is the usual choice. Use Direct only if MGID must see your lander’s domain as the destination. See Direct Campaign Tracking.
Q5: Do I need the {click_price} cost row if I use the cost integration?
A5: No harm in keeping it. With the Cost Model on Not Tracked, the integration takes priority and the click_price value is ignored. If you ever disconnect the integration, the URL cost takes over again.

MGID cost integration

Pull actual spend from MGID’s API.

Traffic source postbacks

Every token you can use in a postback.

Custom conversions

Split leads and sales into separate events.

Conversions not showing

The general checklist when postbacks don’t arrive.