Postback macros for ad networks

At a glance: As an ad network, you can define the content and endpoints of postbacks sent to you as part of your integration with AppsFlyer. Postbacks relate to app user engagement like installs, in-app events, re-engagements, and so on.

Related integrated partner postback guides:

Postbacks for ad networks

  • Postback configuration: To request changes to your postback settings, contact or your AppsFlyer partner development manager. 
  • Postback types: Postbacks are available for install and in-app events and blocked install and in-app events (due to fraud identified by Protect360 or in violation of targeting validation rules).
Postback data sources
来源 description

Parameters provided by the partner on click and impression URLs

例如: 追踪链接的点击 ID 参数 -"&click_id=CLICK_ID"

Partner IDs in AppsFlyer

Unique IDs provided to the advertiser by the partner

Examples: app ID, account ID, user ID, network ID

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

Derived by the AppsFlyer platform

Information derived by the AppsFlyer platform. 

Protect360 and validation rules Information about installs identified as fraud and installs violating campaign targeting rules, and their associated in-app events


When included in a postback, macros are replaced with the user-relevant data. For example, to get the IP address of the user installing the app, include country_code=(ip) in the postback structure. Supported macros supported are listed in the following table:

The columns in the table that follows have the following meaning:

  • Source: Where the data originates from.
    • Link: Attribution links
    • SDK: AppsFlyer SDK embedded in the app or server-to-server API
    • AF: After processing by AppsFlyer
  • Send all: If yes, you can receive the data of installs and events attributed to other networks or organic. (Means not attributed to you). 
  • [Base] Macros for all postbacks: Macros relevant to install, in-app event, and rejected event postbacks
  • [Optional] for in-app events and rejected events as indicated in the column (rejected, in-app)
Macros—installs, in-app events, and rejected events
回传宏(名称) 来源 发送全部 description [Base] Macros for all postbacks [Optional] In-app and rejected events
advertising_id SDK User-resettable device ID, AKA GAID. Also available as: (sha1-advertiserId)  
app_name SDK App name set by the advertiser  
appsflyer_id SDK AppsFlyer unique identifier recorded upon conversion  
attributed_touch_type SDK Possible values: click, impression, TV, pre-install  
blocked_reason AF Fraud/validation rules reason Rejected
blocked_reason_value AF Fraud/validation rules reason value (like site ID) Rejected
blocked_sub_reason AF Fraud/validation rules sub-reason Rejected
bundle_id SDK iOS: Identification to match either a single app or a group of apps in iOS (See Apple developer bundle ID) Android: The app name  
country_code AF Country Code using ISO 3166 (alpha-2) Example: US, CN.  
event_name SDK 分配给事件的名称 应用内
event_revenue_USD AF 事件价值 (美元) 应用内
event_revenue SDK Event value reported by SDK using event_revenue_currency or currency selected by you. 应用内
SDK The event revenue currency code reported in the event or the currency selected by you 应用内
event_time SDK 事件时间 应用内
event_value SDK in-app event includes attributes with values, which can be sent entirely on the postback in JSON format. URL encoded using the (encode) macro. 应用内
idfa SDK User resettable advertising ID found on iOS devices Also available as: (sha1-idfa)  
idfv SDK Unique identifier per user per vendor on IOS devices  
install_time SDK Install timestamp  
install_unix_ts SDK Install timestamp in unix format  
is_attributed AF 标记,指示安装或事件是否归因于此渠道  
is_lat SDK Limit ad tracking (LAT): iOS: Starting iOS 14 LAT is deprecated by Apple. Determine user privacy status using ATT. In this case disregard is_lat. Before iOS 14, if true, IDFA is not available and is set to 0. Android: When true, the user has opted-out of interest-based ads. This does not prevent the collection of GAID.  
is_primary_attribution AF

If false, see is_retargeting.

is_retargeting 链接

Use in conjunction with is_primary_attribution. Learn more about double attribution of retargeting events.

If true (1), the event is reported as part of a retargeting campaign and the media source is the retargeting media source.

If false (0) and is_primary_attribution is false, the event is part of a retargeting campaign but the media source referenced is the user attribution media source


语言 SDK Language (locale) reported by the device and set by the device OS.  
oaid SDK 在某些 Android 设备上,用户可重置的 ID 是 GAID 备选  
partner_event_id AF Name/ID of the corresponding event in the partner's platform 应用内
平台 SDK 设备系统:iOS、Android 或 Windows Mobile  
再营销转化类型 AF A flag marking if this is a re-attribution or re-engagement Retargeting only  
app_version SDK App version name set by the developer in the app code  
app_id SDK The app ID as reported by the app   
att-0-1 SDK

Possible values:

  • 1: The ATT status is authorized or af_authorized.
  • 0: Any other ATT status. 
att-status SDK

The ATT status reported by iOS. Like authorized, not_determined. 

In some cases there is no value and "" is returned. 

af_ad 链接


af_ad_id 链接


af_adset 链接
  • 由广告商/发行商提供
  • 广告集是广告系列和广告层次结构之间的中间层级。查看更多
af_adset_id 链接 由广告商/发行商提供
C 链接 广告系列名称-由广告主/发行商提供。名称长度超过100个字符的广告系列在控制面板上会被显示为"c_name_exceeded_max_length"
af_c_id 链接 由广告商/发行商提供
af_siteid 链接
  • Unique ID that identifies the publisher that displays the ad. Learn more
af_subsite_id 链接
  • 次级广告平台/发行商ID。
  • 如果除了主要媒体(子渠道)以外还有次级媒体,或者您想要了解广告样式(如横幅、插屏、视频)等的其他信息,请使用af_sub_siteid参数。示例:af_sub_siteid =ABCD_4567
af_ad_type 链接

Use the following naming convention:

  • text仅包含文本的广告单元,比如搜索结果
  • banner: 显示在设备屏幕顶部或底部的基本格式
  • interstitial: 在当前体验的休息时间出现的全页广告
  • video无奖励的标准视频
  • rewarded_video: 通过观看视频的广告单元换取应用内奖励
  • playable:一个n广告单元,其中包含应用程序体验的交互式预览
  • Sponsored_content: 赞助内容中包含链接,如广告文章
  • audio:一个音频广告
imei SDK

A unique number used to identify mobile phones


In-app event only macros

The examples that follow relate to in-app event postbacks available to partners.


事件回传模板 "&event=(event)&json=(encode)" 被转换为特定 af_purchase 事件的以下回传:


此回调的解码 JSON 值是


Encoded values

Postbacks may contain irregular characters, which are not alpha-numerical. To transfer these values correctly via postbacks, AppsFlyer URL-encodes non-alpha-numerical values.

To decode or encode a postback use an encoding web service. 



Android iOS


Android iOS

 In-app event postback example


  • 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"}

currency=USD&revenue=120.00&json=%7B%22af_quantity%22%3A1%2C%22 />af_revenue