Available Macros on AppsFlyer's Postbacks

  • Ad Networks

Introduction

When mobile users install or perform in-app events AppsFlyer sends postbacks to the originating networks or to other endpoints, which may include a wide array of macros.

There are 3 different sources for postbacks data, which AppsFlyer can send back to ad networks:
  1. Tracking link parameters
    Parameters provided by the partner on click or impression URLs can be returned on the postback URLs.
    Example: click ID parameter on the tracking link - "&click_id=CLICK_ID"
  2. Partner IDs in AppsFlyer
    Unique IDs given to the advertiser by the partner can be sent back via postbacks.
    Examples: app ID, account ID, user ID, network ID, SDK key etc.

    integration_key.png

  3. SDK derived information
    Information extracted from the device by AppsFlyer's SDK 
    Example: iOS device IDs can be extracted by using "&IDFA=(idfa)" on the postback 

 Important!

To update the structure and information on postback messages, ad networks should contact their relevant AppsFlyer Partners Development contact

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. 

Installs and In-App Events Macros

Macro Source Description

(idfa)

SDK

iOS unique identifier.
Also available as: (sha1-idfa)

(advertiserId)

SDK

Android GAID unique identifier.
Also available as: (sha1-advertiserId)

(android-id)

SDK

Android ID unique identifier.
Also available as: (sha1-android-id)

(app-id)

SDK

Name of the app id 

(wifi)

SDK

Type of data connection used by the user on conversion ("TRUE" or "FALSE")

(install-unix-ts)

SDK

Timestamp of install (first app open) in UNIX time

(click-ts)

SDK

Click or impression time on AppsFlyer tracking link

(campaign)

Link

Campaign name as sent in AppsFlyer tracking link (c=)

(publisher_id)

Link

Site ID as sent in AppsFlyer tracking link (af_siteid=)

(country-code)

SDK

Two-character country code recorded on conversion

(city)

SDK

City of user device recorded on conversion

(device-brand)

SDK

Device brand of user device recorded on conversion

(carrier)

SDK

Service provider for the device (such as "AT&T")

(ip)

SDK

IP of the user device recorded on conversion

(device-model)

SDK

Model of the user device recorded on conversion

(language)

SDK

Name of the language used on the user device recorded on conversion

(appsflyer-device-id)

SDK

AppsFlyer unique identifier recorded on conversion

(sdk-version)

SDK

AppsFlyer SDK version

(app-version-name)

SDK

App version setup by app developer in the app's code

(user-agent)

SDK

The User-Agent format (e.g. "Mozilla/5.0 (iPad)"

(vendorId)

SDK

ID for vendors such as IDFV for iOS

(os-version)

SDK

The version name of the Operating System

(app-name)

SDK

The name of the application

(match-type)

SDK

The attribution match type (e.g uid (id_matching), ref (gp_referrer) and fp (fingerprint))

(gp_referrer_click_ts)

SDK

The time when Google Play is opened

(gp_referrer_install_ts)

SDK

The time when the user clicks Install on Google Play


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

(event-name)

Name of the event triggered from the app

(mapped-iae)

Name/ID of the corresponding event in the partners platform

(monetary)

Event value in USD

(orig-monetary)

Event value in original currency as configured in application

(currency)

Event Currency code

(timestamp)

The time of the in-app event

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

 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?
3 out of 3 found this helpful

Comments

0 comments

Please sign in to leave a comment.