Postback macros for Ad Networks

At a glance: When mobile users install or perform in-app events, AppsFlyer sends postbacks to the originating ad networks and to other endpoints as defined. These postbacks may include macros.

AppsFlyer sends postbacks to ad networks using the following data sources:
  • Attribution link parameters: Parameters provided by the partner on click, by impression URLs can be returned on the postback URLs. Example: click ID parameter on the attribution link - "&click_id=CLICK_ID"
  • Partner IDs in AppsFlyer: Unique IDs given to the advertiser by the partner can be sent back via a postback. Examples: app ID, account ID, user ID, network ID, SDK key etc.
  • SDK derived information: Information extracted from the device by the AppsFlyer SDK. Example: iOS device IDs can be extracted by using "&IDFA=(idfa)" on the postback
  • Protect360 and Validation Rules: Information about installs identified as fraud and installs violating campaign targeting rules, and their associated in-app events. 

Changing postback settings

  • Ad networks request changes to macro settings by reaching out to their AppsFlyer partner development manager
  • Postbacks are available for:
    • install and in-app events
    • Blocked Install and in-app events due to fraud identified by Protect360 or violation of Targeting Validation rules.

Supported postback macros

Below you can find the full list of AppsFlyer's supported macros. These macros, when placed on a postback, are automatically replaced with the user relevant data. For example, to get the IP address of the installing users include "&ip_address=(ip)" in the postback structure.

  • Source: indicates from where the data is received (SDK or link)
  • Send all: indicates whether you can receive this data about installs and events that are not attributed to your network (including organic)

Installs and in-app events macros

Macro Source Description Send all
(app-id) SDK Name of the app id Y
(app-name) SDK The name of the application Y
(app-version-name) SDK App version setup by app developer in the app's code Y
(appName) SDK App name (e.g. com.appsflyer.adNetworkTest) Y
(appsflyer-device-id) SDK AppsFlyer unique identifier recorded on conversion Y
(bundle-id) SDK App ID (e.g. com.appsflyer.adNetworkTest) Y
(sdk-version) SDK AppsFlyer SDK version Y
(campaign) Link Campaign name as sent in AppsFlyer attribution link (c=) N
(click-ts) SDK Click or impression time on AppsFlyer attribution link N
(unix-ts) SDK The timestamp value in the Unix time format (e.g. 1510000000) Y
(gp_referrer_click_ts) SDK The time when Google Play is opened N
(gp_referrer_install_ts) SDK The time when the user clicks Install on Google Play N
(install-ts) SDK The install timestamp Y
(install-unix-ts) SDK Timestamp of install (first app open) in UNIX time Y
(publisher_id) Link Site ID as sent in AppsFlyer attribution link (af_siteid=) Y
(match-type) SDK The attribution match type (e.g uid (id_matching), ref (gp_referrer) and fp (Probabilistic modeling)) N
(is_attributed) SDK A flag marking if the install or event is attributed to this media source Y
(is-impression) SDK A flag marking if the attribution occurred due to a view-through (1 = impression, 0 = click) N
(is-reattr-tf) SDK A flag marking if this is a reattribution campaign (TRUE/FALSE) N
(is-reattr) SDK A flag marking if this is a reattribution campaign (1/0) N
(is-reengage-tf) SDK A flag marking if this is a re-engagement campaign (TRUE/FALSE) N
(is-reengage) SDK A flag marking if it is a re-engagement campaign (0/1) N
(is-retarget-tf) SDK A flag marking if this is a retargeting campaign (TRUE/FALSE) N
(is-retarget) SDK A flag marking if this is a retargeting campaign (1/0) N
(is-s2s-0or-1) SDK Source of the install or event - S2S/Not S2S (1/0) Y
(is-s2s) SDK Source of the install or event - S2S/Not S2S (TRUE/FALSE) Y
(is-tracking-disable-0-or-1) SDK A flag marking if ad tracking is disabled (1/0) N
(is-tracking-disable) SDK A flag marking if the user chose to disable limited ad tracking (LAT). Can be TRUE or FALSE. N
(is-tracking-enable-0-or-1) SDK A flag marking if the user chose to enable LAT - limited ad tracking (1/0) Y
(is-tracking-enable) SDK A flag marking if the user chose to enable LAT - limited ad tracking (TRUE/FALSE) Y
(android-id) SDK Android ID unique identifier.
Also available as: (sha1-android-id)
Y
(idfa) SDK iOS unique identifier.
Also available as: (sha1-idfa)
Y
(ip) SDK IP of the user device recorded on conversion Y
(language) SDK Name of the language used on the user device recorded on conversion Y
(operator) SDK User's cellular operator (e.g. airtel) Y
(os-version) SDK The version name of the Operating System Y
(platform) SDK Device platform (IOS/Android) Y
(device-brand) SDK Device brand of user device recorded on conversion Y
(device-model) SDK Model of the user device recorded on conversion Y
(device-type) SDK Device type (e.g. IPHONE, SAMSUNG) Y
(advertiserId) SDK Android GAID unique identifier.
Also available as: (sha1-advertiserId)
Y
(user-agent) SDK The User-Agent format (e.g. "Mozilla/5.0 (iPad)" Y
(vendorId) SDK ID for vendors such as IDFV for iOS Y
(wifi) SDK Type of data connection used by the user on conversion (TRUE/FALSE) Y
(carrier) SDK Service provider for the device (such as "AT&T") Y
(city) SDK City of user device recorded on conversion Y
(region) SDK Region of user's IP address Y
(state) SDK State of user's IP address 
(postal-code) SDK Postal/ZIP code Y
(country-code) SDK Two-character country code recorded on conversion Y
(blocked-reason) Blocking* Fraud reason (e.g. devicerank, bots, click_flood) N
(blocked-reason-value) Blocking* Fraud reason value (e.g. Advertising ID, Site ID) N
(transaction-id) SDK A unique value generated by Appsflyer (e.g. DgC3kh7hWMMC-kPeFLSjNA) Y
(random-str) SDK Random string generated by Appsflyer. Y
(oaid) SDK Android non-permanent device identifier Y
(blocked-sub-reason) Blocking* Fraud sub-reason (high_fraud_rate, new_devices) N
* Blocking: Protect360 or targeting Validation Rules as the case maybe  

In-app events only macros

The macros below are only available for postbacks sent to partners following an in-app (or server to server) event:

Macro Description Send all 

(event-name)

Name of the event triggered from the app

Y

(mapped-iae)

Name/ID of the corresponding event in the partners platform

Y

(monetary)

Event value in USD

Y

(orig-monetary)

Event value in original currency as configured in application

Y

(currency)

Event Currency code

Y

(timestamp)

The time of the in-app event

Y

(event-value)

Enhanced rich in app event include attributes with values, which can be sent entirely on the postback in JSON format, URL encoded using the (encode) macro.

Y

(is-primary)

Represents the Retargeting flag, equivalent to "is-primary" column on reports (TRUE/FALSE)

Y

 Example

Event postback template "&event=(event)&json=(encode)" was translated to the following postback for a specific af_purchase event:

&event=af_purchase&json=%7B%22af_quantity%22%3A1%2C%22
af_revenue%22%3A%2212000%22%2C%22af_currency%22%3A%
22USD%22%2C%22af_content_id%22%3A%221107%22%2C%22
af_content_type%22%3A%22default_type%22%7D%0A

The decoded JSON value of this postback is

{"af_quantity":1,"af_revenue":"12000","af_currency":"USD","af_content_id":"1107","af_content_type":"default_type"}

Encoded values

Postbacks may need to contain irregular characters, which are not alpha-numerical. To accurately transfer these values via the postbacks, AppsFlyer URL-encodes non alpha-numerical values in postbacks.

If you wish to decode an encoded postback, or encode a decoded postback, you can use any free encoding web service, such as this.

Sample postbacks

General install postback examples

Android iOS
http://YourCompanyDomain.com?clickid=(clickid)&site_id=(publisher_id)
&device_ip=(ip)&advertising_id=(advertiserId)&android_id=(android-id)
&install_time=(install-unix-ts)

General in-app event postback examples

Android iOS
http://YourCompanyDomain.com?clickid=(clickid)&site_id=(publisher_id)&
device_ip=(ip)&advertising_id=(advertiserId)&android_id=(android-id)&
install_time=(install-unix-ts)&event_name=(event-name)&currency=(currency)&
json=(event-value)

Rich in-app event postback example

Event Parameters:

Event Name: af_revenue
Event Revenue: 120.00
Event Currency: USD
Event Value: {"af_quantity":1,"af_revenue":"120","af_currency":"USD","af_content_id":"1107","af_content_type":"default_type"}

Postback:

http://YourCompanyDomain.com?clickid=8594845&site_id=click123&device_ip=
38.166.144.142&advertising_id=121sxxxx-xxxx-xxxx-xxxx-52454bd7500b&
android_id=9aaeecc4455xxxxx&;install_time=1451923560&event_name=af_purchase&
currency=USD&revenue=120.00&json=%7B%22af_quantity%22%3A1%2C%22 />af_revenue
%22%3A%22120.10%22%2C%22af_currency%22%3A%22USD%22%2C%22af_content_id
%22%3A%221107%22%2C%22af_content_type%22%3A%22default_type%22%7D%0A
Was this article helpful?