Tracking Macro Reference

Every macro Affclix resolves, every parameter the advertiser postback accepts, and how each mobile measurement partner (MMP) maps onto them. Macros are placeholders in curly braces that Affclix replaces with a real value at click or conversion time; postback parameters are the values an advertiser or MMP sends back to report a conversion.

How Macros Work

You write the token; the platform replaces it. A campaign URL containing {click_id} is stored with the token intact, and each visitor is redirected to a version with their own value substituted. Values are URL-encoded on substitution, so a sub-ID containing a space or & cannot break the URL.

Stored campaign URL
https://advertiser.com/offer?cid={click_id}&geo={country}&src={sub_aff1}
What the visitor is redirected to
https://advertiser.com/offer?cid=a7f3c9e1b204&geo=US&src=newsletter

Macros and parameters appear in three places, and it matters which one you are editing:

WhereDirectionWhat goes in it
Campaign and landing page URLsAffclix → advertiserClick macros, resolved on every click.
Affiliate postback URLAffclix → affiliateClick macros plus conversion macros, resolved when a conversion is recorded.
Advertiser / MMP postbackAdvertiser → AffclixQuery parameters the advertiser fills with their own values (or their MMP's macros).

You do not have to type them. The All Macros panel on the campaign form lists every token with its description and inserts it at your cursor, and Quick Tokens below the URL field covers the common ones. A token with no value for a given click resolves to an empty string.

Core Identifiers

MacroSubstituted with
{click_id}Unique ID of the recorded click. The key the advertiser or MMP returns on the postback.
{campaign_id}Campaign ID.
{campaign_name}Campaign name.
{affiliate_id}Affiliate ID.
{advertiser_id}Advertiser ID.
{source}Publisher source label.
{creativeid}Creative ID, for per-asset performance.
{external_id}External ID passed on the click, when present.
{timestamp}Click time as a Unix timestamp (seconds, UTC).
{mmp_sig}Signature that lets the Affclix MMP verify the click came from this tracker. Used on Affclix MMP links only.
{click_id} is the one that cannot be omitted

It is the only value that ties a conversion back to a specific click, affiliate and payout. A campaign URL without it will record clicks and never attribute a conversion.

Visitor, Geo and Device

MacroSubstituted with
{country}ISO country code resolved from the visitor IP.
{region}State or region name.
{city}City name.
{isp}Internet service provider.
{ip}Visitor IP address.
{os}Operating system.
{os_version}OS version — for iOS 14, this is 14.
{device_lang}Browser / device language.
{user_agent}Full browser user agent string.
IP and user agent are personal data in most jurisdictions

Passing {ip} or {user_agent} to a third party may need a lawful basis and a processing agreement under GDPR and similar regimes. Only forward them where the advertiser has a documented reason — fraud checks, usually — and where your privacy notice covers it.

Affiliate Sub-IDs

Ten free-form slots the affiliate fills at click time, plus their own click identifier. These are the dimensions affiliates optimise on, and each becomes a filterable column in the Clicks Report.

MacroSubstituted with
{aff_click_id}The affiliate's own click ID. Return it in the affiliate postback so they can reconcile.
{sub_aff1} – {sub_aff10}Ten affiliate sub-ID slots.
{sub_aff_id}, {sub_aff_id1} – {sub_aff_id6}Legacy aliases of {sub_aff1} – {sub_aff6}. Still resolved so older URLs keep working; use the sub_aff form in new setups.
Agree a slot convention and keep it

Reports only compare across campaigns if sub_aff1 means the same thing everywhere. A common convention is source, creative, placement, ad set, then variant.

Mobile Advertising IDs

Required for app install attribution and for matching against an MMP's own records.

MacroSubstituted with
{gaid}Google Advertising ID (Android).
{iosidfa}iOS IDFA.
{androidid}Android ID.
{deviceid}Generic device identifier.

On iOS the IDFA is only available when the user has granted App Tracking Transparency permission, so expect it to be empty far more often than not. See Probabilistic Attribution for how installs are matched when no device ID is present.

Ad Platform Click IDs

Capture these on the click if you send conversions back to the ad platform through a Conversions API — without the click ID, the platform cannot match your conversion to its own ad spend.

MacroPlatform
{fbclid}Meta (Facebook and Instagram) click ID
{fbp}, {fbc}Meta browser and click cookies, for Meta Conversions API matching
{gclid}Google Ads
{dclid}Google Display
{gbraid}, {wbraid}Google, iOS app and web-to-app journeys
{ttclid}TikTok
{msclkid}Microsoft and Bing

UTM and Flow Tokens

MacroSubstituted with
{utm_source}, {utm_medium}, {utm_campaign}, {utm_term}, {utm_content}The UTM values captured on the click, forwarded so the advertiser's analytics attributes the traffic to the right channel.
{lp_url}, {landing_url}The offer URL the flow selected for this click, URL-encoded. Use it as the call-to-action target on a pre-lander. Resolved on the click redirect only.

Affiliate Postback Macros

Resolved when Affclix fires the postback to an affiliate after a conversion. Every click macro above also resolves here, so {aff_click_id} and the sub-IDs can be returned to the affiliate.

MacroSubstituted with
{payout}The affiliate's payout for this conversion.
{currency}Currency of the affiliate payout.
{sale}, {sale_amount}Sale / order value reported by the advertiser.
{revenue}Always empty. It is what the advertiser pays the network, and network margin is never disclosed to affiliates.
{status}Conversion status (approved, pending, rejected).
{conversion_id}Affclix's own conversion ID — unique per conversion. The safest deduplication key to give an affiliate.
{transaction_id}The advertiser's transaction ID, as received on the postback.
{order_id}The advertiser's order ID, as received on the postback.
{event}, {goal}The goal's event token (for example install, registration). Use this when the affiliate filters by goal.
{event_name}The goal's display name.
{event_id}The goal's numeric ID on the campaign. It is the same for every conversion of that goal — never use it as a deduplication key.

Advertiser Postback Parameters

The query parameters Affclix reads on the advertiser S2S postback (and on MMP postbacks, which are translated into the same names). These are parameter names, not macros: the advertiser fills each one with their own value, or with their MMP's macro. Common names from other trackers are accepted as aliases so a copied postback keeps working.

Advertiser postback
https://track.yourdomain.com/p?click_id={CLICK_ID}&e=purchase&sale=499.00&currency=INR&txn_id={ORDER_ID}&auth={SECURITY_TOKEN}
ParameterAlso acceptedRequiredMeaning
click_id—RequiredThe {click_id} value Affclix sent on the click. Optional only for coupon-attributed and privacy (SKAN) postbacks.
e—OptionalEvent token of the goal to book. Omitted means the campaign's default goal.
txn_idtransaction_id, txidRecommendedUnique ID of this conversion. Primary deduplication key — see below.
order_id—RecommendedThe advertiser's order reference. Used for deduplication when no txn_id is sent.
salesum, sale_amount, amountFor CPS / RevShareOrder value, in whole currency units. The basis for percentage payouts.
currency—OptionalISO 4217 code of sale, for example INR.
payout—OptionalA fixed payout override. Only honoured on an authenticated postback.
status—Optionalapproved, pending or rejected (also 1 / 2 / 0). Sent with a known txn_id, it updates that conversion instead of creating a new one.
couponcoupon_code, promo_codeOptionalCoupon used on the order. Attributes the conversion to the coupon's affiliate when there is no click.
uid—OptionalThe advertiser's own user / player ID. Links events of one user for KYC, FTD and lead-window rules.
sub_adv1 – sub_adv6—OptionalAdvertiser-side pass-through values, stored on the conversion.
auth—Per settingsYour workspace postback security token. Required when signed postbacks are enforced, and always for privacy postbacks.

Transaction ID and Deduplication

Advertisers and MMPs retry postbacks on timeouts and errors. Affclix treats a second postback with the same txn_id on the same campaign, within 90 days, as a duplicate and rejects it with DUPLICATE_TRANSACTION_ID. When no txn_id is sent, the same check runs on order_id (DUPLICATE_ORDER_ID).

RuleDetail
Unique per conversionOne value per purchase, registration or other action. Two users, or two purchases by one user, must never share a value.
Stable across retriesA retried postback must carry the same value, or it is booked twice.
ScopeChecked per campaign within your workspace, so another advertiser's 1001 never collides with yours.
Empty when unknownSend nothing rather than a placeholder. A fixed default such as NA or 0 makes every conversion after the first a duplicate.
FormatCase-sensitive string with no hard length limit. Keep it under 255 characters, using letters, digits, - and _ (a UUID is ideal), and URL-encode anything else.
Never map an event-type ID to txn_id

Some MMPs expose an ID that names the event type, not the individual event — Apptrove's {event_id} is one. It is identical for every purchase by every user, so the first conversion is booked and every one after it is rejected as a duplicate. Use a per-transaction value such as the order ID.

On MMP postbacks, an empty or unexpanded macro (for example a literal {order_id}) is ignored, and Affclix derives a stable ID from the postback itself so retries are still caught. That derived ID cannot tell apart two events that share the same click, event name and revenue, so map a real transaction ID wherever the MMP has one.

MMP Postback Mapping

Each MMP has its own macro syntax. The setup page under Mobile Attribution generates the full URLs, including your security token; this table shows how each MMP's macros map onto the Affclix parameters.

MMPclick_idesalecurrencytxn_id
AppsFlyer{clickid}{partner_event_identifier}{revenue_amount}—Derived
Adjust{label}{event_name}{revenue_float}{currency}Derived
Singular{clickid}{partner_event_identifier}{revenue_amount}—Derived
Branch${(last_attributed_touch_data.~click_id)!}${(name)!}${(event_data.revenue)!}${(event_data.currency)!}${(event_data.transaction_id)!}
Kochava{click_id}{event_name}{revenue}—Derived
Apptrove{click_id}{event_name}{event_revenue}{event_revenue_currency}{order_id}
Affclix MMP{click_id}{partner_event}{revenue}{currency}{transaction_id}

Derived means the MMP's partner postback has no per-transaction macro, so Affclix generates the ID as described above. A dash under currency means the MMP does not send one: keep the campaign in the same currency the app reports revenue in.

Use separate install and event postbacks

The install postback carries no e and books on the campaign's default goal. Attach the event postback to in-app events only — attached to installs as well, every install arrives twice. Each in-app event name must match a goal's event token on the campaign, or be mapped on the MMP setup page.

Adjust revenue is {revenue_float}, not {revenue}

Adjust reports {revenue} in cents. Swapping it in overstates every sale, and every percentage payout, a hundredfold.

Where to Use Them

LocationTypical tokens
Campaign URL{click_id} always, plus {country}, {sub_aff1} and any device ID the advertiser or MMP needs.
Landing page URLsThe same tokens. They are not inherited from the campaign URL.
Pre-lander call to action{lp_url}.
Affiliate postback{aff_click_id}, {payout}, {currency}, {status}, {goal}, {conversion_id}.
Advertiser postbackclick_id, e, txn_id, sale, currency, auth.
Impression URL{campaign_id}, {affiliate_id}, {creativeid}.

Common Mistakes

MistakeResult
Square brackets or percent signs instead of curly bracesThe token is passed through literally and the advertiser receives the text, not a value.
A typo in the token nameNot recognised, so it is never substituted. Nothing errors — check the resolved URL in the Link Tester.
Tokens on the campaign URL but not on landing pagesTraffic routed to a landing page loses attribution entirely.
An event-type ID, click ID or device ID as txn_idThe value repeats across conversions, so genuine conversions are rejected as duplicates.
No txn_id or order_id on a direct advertiser postbackA retry cannot be told apart from a second sale, and the affiliate may be paid twice.
One MMP postback attached to both installs and eventsEvery install is booked twice.
{event_id} in an affiliate postback as the conversion referenceIt identifies the goal, not the conversion. Send {conversion_id} instead.
Assuming the advertiser reads click_idEvery platform names it differently. Confirm which parameter they expect before launch.

The Link Tester shows the fully substituted URL for a simulated click, which is the fastest way to catch all of the above before real traffic does.

Rate this article
★ ★ ★ ★ ★
Thanks for rating!

Was this article helpful?