Skip to main content

Affiliate macros

Set your affiliate's tracker macros once, so every tracking link you copy for them is ready to use. Includes the recommended macros for Swaarm, Affise, TUNE, CAKE, Trackier and Offer18.

J
Written by Jorge Rubia

Macros tell Aftrad what to put in each parameter of an affiliate's tracking links (click and impression). Set your affiliate's tracker macros once (for example, their click ID macro) and every tracking link you copy for that affiliate is ready to use, with nothing to edit by hand. It's also what makes postbacks work: Aftrad returns the affiliate's click ID with each conversion.

Go to Performance → Affiliates, edit the affiliate and open GENERAL → Macros.


How it works

Each field is a parameter of the tracking link. What you type in the field is the value Aftrad adds to that parameter.

  • Fill a field to add its parameter to the affiliate's tracking links.

  • Leave it empty and the parameter is not added.

  • New affiliates start with {REPLACE} in Click ID, Source and Subsource.

  • Type the macro of your affiliate's tracker (for example {clickid} for Affise), so their platform fills in the real value on every click.

For example, with Click ID = {clickid}, Source = {pid} and Subsource = {sub1}, the tracking link you copy for this affiliate looks like this:

https://yourdomain.com/track/direct?publisher_id=1&offer_id=7&click_id={clickid}&source={pid}&sub_source={sub1}

Part of the link

What it is

yourdomain.com

The affiliate's Default traffic domain.

publisher_id, offer_id

The affiliate ID and the offer ID. Always included.

click_id, source, sub_source…

The parameters filled in the affiliate's Macros.

Note: {REPLACE} is a placeholder: the affiliate must replace it with their own macro before using the link. Set the right macro here and they won't need to.

Available parameters

Field

Parameter in the link

What to send

Click ID

click_id

The affiliate's unique click ID. Always set it: Aftrad returns it in the affiliate postback.

Aggregate ID

aggregate_id

An extra ID the affiliate wants to group clicks by.

Source

source

The affiliate's traffic source (for example, their own publisher ID).

Subsource

sub_source

The affiliate's sub-source (for example, their publisher's sub ID).

Placement

placement

Where the ad was shown.

App Name

app_name

Name of the app where the ad was shown.

App ID

app_id

ID of the app where the ad was shown.

Site

site

Website where the ad was shown.

Creative

creative

The creative (banner, video…) that was clicked.

IDFA

idfa

iOS advertising ID.

GAID

gaid

Google (Android) advertising ID.

IDFV

idfv

iOS identifier for vendors.

ASID

asid

Android App Set ID.

User IP

user_ip

IP address of the user.

User agent

user_agent

User agent of the user's browser or device.

User language

user_language

Language of the user's device.

Custom 1 … Custom 8

custom1 … custom8

Any other value the affiliate wants to pass.

Click Save to apply the changes. From then on, every tracking link and impression tracking link you copy for this affiliate includes these macros (offer → AFFILIATES → ⋯ → Copy Offer tracking link).

Click ID and postbacks

When a conversion happens, Aftrad sends the value it received in click_id back to the affiliate with the {affiliate_click_id} macro of the Affiliate postback. That's how the affiliate's tracker matches the conversion with its own click. Without a Click ID macro, the affiliate can't attribute conversions.


Recommended macros for common trackers

Many affiliates use a tracking platform. Use these macros in the affiliate's Macros depending on their tracker. Type them exactly as shown: braces, # signs and case included.

Tracker

Click ID

Source

Subsource

Swaarm

{id}

{publisher.id}

{publisher.subId}

Affise

{clickid}

{pid}

{sub1}

TUNE (HasOffers)

{transaction_id}

{affiliate_id}

{aff_sub}

CAKE

#oreqid#

#affid#

#s1#

Trackier

{click_id}

{publisher_id}

{source}

Offer18

{tid}

{aff_id}

{sub_aff_id}

In each case, Click ID is the tracker's own click ID, Source is the ID of the tracker's publisher and Subsource is that publisher's sub ID.

Note: Trackers change their macros from time to time. If in doubt, ask your affiliate to confirm them, and send a test click before going live (see Test link with affiliates).

Optional device and user macros

If your affiliate passes device or user data, these are the macros documented by each tracker:

Tracker

IDFA

GAID

User IP

User agent

Swaarm

{device.ids.idfa}

{device.ids.gaid}

{user.ip}

{user.ua}

Affise

—

—

{ip}

{device_ua}

TUNE (HasOffers)

{ios_ifa}

{google_aid}

—

—

Trackier

{idfa}

{gaid}

{ip}

{user_agent}

Offer18

{iosidfa}

{googleaid}

{ip}

{useragent}

The affiliate's postback URL

To report conversions back to the tracker, your affiliate gives you their postback URL. Paste it in the affiliate's GENERAL → Postbacks and fill their click ID and payout parameters with Aftrad macros:

Tracker

Click ID parameter

Payout parameter

Example

Swaarm

click_id

sale_amount

…/postback?click_id={affiliate_click_id}&sale_amount={payout}

Affise

clickid

sum

…/postback?clickid={affiliate_click_id}&sum={payout}

TUNE (HasOffers)

transaction_id

amount

…/aff_lsr?transaction_id={affiliate_click_id}&amount={payout}

CAKE

r

p

…/p.ashx?…&f=pb&r={affiliate_click_id}&p={payout}

Trackier

click_id

revenue

…/acquisition?click_id={affiliate_click_id}&revenue={payout}&security_token=…

Offer18

tid

payout

…/p?m=…&tid={affiliate_click_id}&payout={payout}

Note: Keep the rest of the affiliate's URL as they gave it (domain, offer or account IDs, security token, goal). Only replace their click ID and payout placeholders.


Related articles

Did this answer your question?