MACT 概览
转化事件
API 参考文档
转换事件
POST conversion_event
记录一次移动端测量转化事件。响应会指示 X 或 X Audience Platform(TAP)的归因结果。 这与 GET conversion_attribution endpoint 相关。 响应中将声明 X、TAP,或不归因三者之一。当没有 X 归因时,twitter_attribution
节点将始终存在,且其值为 null
(见下方示例响应)。如果声明了 TAP 归因,则会出现 tpn_attribution
节点,并相应填充。请参阅 TAP 概览 了解更多信息。
有多个可选参数可用于设置与每个转化事件关联的 metadata。此 metadata 不影响归因计算。
资源 URL
https://ads-api.x.com/12/conversion_event
参数
名称 | 说明 |
---|---|
app_id 必填 | 与相应应用商店对应的唯一标识符。 Type: int, string 示例: 333903271 、com.vine.android |
conversion_time 必填 | 转化事件发生的时间,使用 ISO-8601 时间戳格式并包含毫秒。 Type: string 示例: 2014-05-22T02:38:28.103Z |
conversion_type 必填 | 转化事件的类型。 Type: enum 可能的取值: PURCHASE 、SIGN_UP 、INSTALL 、RE_ENGAGE 、UPDATE 、TUTORIAL_COMPLETE 、RESERVATION 、ADD_TO_CART 、ADD_TO_WISHLIST 、LOGIN 、CHECKOUT_INITIATED 、SEARCH 、LEVEL_ACHIEVED 、ACHIEVEMENT_UNLOCKED 、CONTENT_VIEW 、SHARE 、INVITE 、ADDED_PAYMENT_INFO 、SPENT_CREDITS 、RATED |
hashed_device_id 必填 | 采用 HMAC_SHA-256 生成的 IDFA 或 AdID 的 hash。 Type: string 示例: ABCD1234XYZ |
os_type 必填 | 该 App 的操作系统类型。 Type: enum 可能的取值: IOS 、ANDROID |
click_window 可选 | 此事件的点击回溯窗口(天)。 Type: int 注意: click_window 必须大于或等于 view_through_window默认值: 14 可能的取值: 1 、7 、14 、30 |
device_ip_address 可选 | 转化事件发生时设备的 IPv4 或 IPv6 地址。 Type: string 示例: 192.133.78.1 |
level 可选 | 与此事件关联的等级/关卡。 Type: int 示例: 2 |
non_twitter_engagement_time 可选 | 转化之前最近一次非 Twitter 互动的时间。 Type: string 示例: 2014-05-22T02:38:28.103Z |
non_twitter_engagement_type 可选 | 转化事件之前的非 Twitter 互动类型。 Type: enum 可能的取值: CLICK 、VIEW |
number_items 可选 | 与此事件关联的商品/项目数量。 Type: int 示例: 2 |
price_currency 可选 | 需为 ISO 4217 代码,用于表示与此事件关联的货币。 Type: string 示例: EUR 、USD 、JPY |
price_micro 可选 | 与此事件关联的价格,单位为微额(micro)。 Type: int 示例: 123450000 |
user_payment_info 可选 | 布尔值,表示与此事件关联的 App 中是否存储了用户的支付信息。 Type: bool 可能的取值: true 或 false |
view_through_window 可选 | 此事件的曝光回溯窗口(天)。 注意: click_window 必须大于或等于 view_through_window。Type: int 默认值: 1 可能的取值: 0 、1 、7 、14 、30 |
示例请求
https://ads-api.x.com/12/conversion_event?app_id=333903271&os_type=IOS&hashed_device_id=ABCD1234XYZ&conversion_type=INSTALL&conversion_time=2013-04-16T07:00:00.123Z&click_window=14&view_through_window=1
示例响应
GET accounts/:account_id/app_event_tags
检索与当前账户关联的部分或全部 App 事件标签的详细信息。 这些标签用于定义移动 App 转化跟踪中为各类转化类型配置的转化窗口。资源 URL
https://ads-api.x.com/12/accounts/:account_id/app_event_tags
参数
名称 | 说明 |
---|---|
account_id 必填 | 被使用的账户标识符。该参数出现在资源路径中,通常对除 GET accounts 外的所有 Advertiser API 请求都是必需的。指定的账户必须与已认证用户关联。 Type: string Example: 18ce54d4x5t |
app_event_tag_ids 可选 | 通过指定以逗号分隔的标识符列表,仅返回所需的 App 事件标签。最多可提供 200 个 ID。 Type: string Example: jhp |
count 可选 | 指定每个独立请求尝试检索的记录数。 Type: int Default: 200 Min, Max: 1 , 1000 |
cursor 可选 | 指定用于获取下一页结果的游标。更多信息参见 分页。 Type: string Example: 8x7v00oow |
sort_by 可选 | 按受支持的属性进行升序或降序排序。更多信息参见 排序。 Type: string Example: created_at-asc |
with_deleted 可选 | 在请求中包含已删除的结果。 Type: boolean Default: false Possible values: true , false |
with_total_count 可选 | 在响应中包含 total_count 属性。注意:此参数与 cursor 互斥。注意:包含 total_count 的请求将具有较低的请求速率限制,目前为每 15 分钟 200 次。Type: boolean Default: false Possible values: true , false |
示例请求
GET https://ads-api.x.com/12/accounts/18ce54d4x5t/app_event_tags?app_event_tag_ids=jhp
示例响应
GET accounts/:account_id/app_event_tags/:app_event_tag_id
检索与当前账户关联的特定 App 事件标签。 这些标签用于定义移动应用转化跟踪中各转化类型的转化窗口设置。资源 URL
https://ads-api.x.com/12/accounts/:account_id/app_event_tags/:app_event_tag_id
参数
名称 | 说明 |
---|---|
account_id 必填 | 所使用账户的标识符。该值出现在资源路径中,通常是除 GET accounts 外所有 Advertiser API 请求的必填参数。指定的账户必须与已认证用户关联。 Type: string Example: 18ce54d4x5t |
app_event_tag_id 必填 | 你在请求中所操作的 app event tag 的引用。 Type: string Example: jhp |
with_deleted 可选 | 在请求结果中包含已删除项。 Type: boolean Default: false Possible values: true , false |
示例请求
GET https://ads-api.x.com/12/accounts/18ce54d4x5t/app_event_tags/jhp
示例响应
POST accounts/:account_id/app_event_tags
创建与当前账号关联的新 App 事件标签。资源 URL
https://ads-api.x.com/12/accounts/:account_id/app_event_tags
参数
名称 | 说明 |
---|---|
account_id 必填 | 目标账户的标识符。出现在资源路径中,通常是除 GET accounts 之外所有 Advertiser API 请求的必需参数。指定的账户必须与已通过身份验证的用户关联。 Type: string Example: 18ce54d4x5t |
app_store_identifier 必填 | 应用商店标识符。 Type: string Example: com.twitter.android |
conversion_type 必填 | 转化事件类型。 Type: enum Possible values: ACHIEVEMENT_UNLOCKED , ADDED_PAYMENT_INFO , ADD_TO_CART , ADD_TO_WISHLIST , CHECKOUT_INITIATED , CONTENT_VIEW , INSTALL , INVITE , LEVEL_ACHIEVED , LOGIN , PURCHASE , RATED , RESERVATION , RE_ENGAGE , SEARCH , SHARE , SIGN_UP , SPENT_CREDITS , TUTORIAL_COMPLETE , UPDATE |
os_type 必填 | 应用的操作系统类型。 Type: enum Possible values: IOS , ANDROID |
provider_app_event_id 必填 | 提供商站点上的转化标签 ID。 Type: string Example: provider_tag_j5394 |
provider_app_event_name 必填 | 提供商站点上的转化标签名称。 Type: string Example: provider_name_a4382 |
deep_link_scheme 可选 | 指定与此标签关联的应用的深度链接 URI。 Type: string Example: twitter:// |
post_engagement_attribution_window 可选 | 这些事件的互动后归因窗口。 Type: int Default: 30 Possible values: 1 , 7 , 14 , 30 |
post_view_attribution_window 可选 | 这些事件的曝光后归因窗口。 Type: int Default: 1 Possible values: 0 , 1 , 7 , 14 , 30 |
retargeting_enabled 可选 | 指定是否为此应用事件标签启用重定向(再营销)。 Type: boolean Default: true Possible values: true , false |
示例请求
POST https://ads-api.x.com/12/accounts/18ce54d4x5t/app_event_tags?app_store_identifier=com.twitter.android&os_type=ANDROID&conversion_type=PURCHASE&provider_app_event_id=abc123&provider_app_event_name=test-tag
示例响应
DELETE accounts/:account_id/app_event_tags/:id
删除当前账户所属的指定 App 事件标签。资源 URL
https://ads-api.x.com/12/accounts/:account_id/app_event_tags/:id
参数
名称 | 描述 |
---|---|
account_id 必填 | 已借用账户的标识符。该参数出现在资源路径中,通常是除 GET accounts 外所有 Advertiser API 请求的必填参数。指定的账户必须与已通过身份验证的用户关联。 Type: string Example: 18ce54d4x5t |
id 必填 | 请求中所操作的 App 事件标签的引用。 Type: string Example: jhp |
示例请求
DELETE https://ads-api.x.com/12/accounts/18ce54d4x5t/app_event_tags/jhp
示例响应
App 列表
GET accounts/:account_id/app_lists
获取与当前账户关联的部分或全部 App 列表的详细信息。资源 URL
https://ads-api.x.com/12/accounts/:account_id/app_lists
参数
名称 | 说明 |
---|---|
account_id 必填 | 被使用账户的标识符。该标识符会出现在资源路径中,通常是除 GET accounts 外所有 Advertiser API 请求的必填参数。指定的账户必须与已认证用户关联。 Type: string Example: 18ce54d4x5t |
app_list_ids 可选 | 通过提供以逗号分隔的标识符列表,将响应限定为所需的 App 列表。最多可提供 200 个 ID。 Type: string Example: wm7x |
count 可选 | 指定每个请求尝试检索的记录数量。 Type: int Default: 200 Min, Max: 1 , 1000 |
cursor 可选 | 指定用于获取下一页结果的游标。更多信息参见 Pagination。 Type: string Example: 8x7v00oow |
sort_by 可选 | 按受支持的属性进行升序或降序排序。更多信息参见 Sorting。 Type: string Example: created_at-asc |
with_deleted 可选 | 在请求中包含已删除的结果。 Type: boolean Default: false Possible values: true , false |
with_total_count 可选 | 包含 total_count 响应属性。注意:此参数与 cursor 互斥。注意:包含 total_count 的请求将受到更低的请求速率限制,目前为每 15 分钟 200 次。Type: boolean Default: false Possible values: true , false |
示例请求
GET https://ads-api.x.com/12/accounts/18ce54d4x5t/app_lists?app_list_ids=wm7x
示例响应
GET accounts/:account_id/app_lists/:app_list_id
获取与当前账户关联的特定 App 列表。资源 URL
https://ads-api.x.com/12/accounts/:account_id/app_lists/:app_list_id
参数
名称 | 说明 |
---|---|
account_id 必填 | 目标账户的标识符。出现在资源路径中,通常是除 GET accounts 之外所有 Advertiser API 请求的必需参数。指定的账户必须与已验证用户关联。 Type: string Example: 18ce54d4x5t |
app_list_id 必填 | 在本次请求中所操作的 App 列表的引用。 Type: string Example: 28ukf |
with_deleted 可选 | 是否在响应中包含已删除的结果。 Type: boolean Default: false Possible values: true , false |
示例请求
GET https://ads-api.x.com/12/accounts/18ce54d4x5t/app_lists/28ukf
示例响应
POST accounts/:account_id/app_lists
创建一个与当前账户关联的app_list
。
目前,每个 account_id
最多可拥有 100 个 app_list
对象,每个 app_list
最多可包含 500 个 App。
资源 URL
https://ads-api.x.com/12/accounts/:account_id/app_lists
参数
名称 | 说明 |
---|---|
account_id 必填 | 所使用账户的标识符。出现在资源路径中,一般为除 GET accounts 外所有 Advertiser API 请求的必填参数。指定的账户必须与已通过认证的用户关联。 Type: string Example: 18ce54d4x5t |
app_store_identifiers 必填 | 要包含在 app_list 中的应用商店标识符。Type: string Example: com.twitter.android |
name 必填 | 要为 app_list 指定的名称。Type: string Example: My First App List |
示例请求
POST https://ads-api.x.com/12/accounts/18ce54d4x5t/app_lists?name=app list&app_store_identifiers=com.twitter.android
示例响应
DELETE accounts/:account_id/app_lists/:app_list_id
删除当前账户关联的指定 App 列表。资源 URL
https://ads-api.x.com/12/accounts/:account_id/app_lists/:app_list_id
参数
名称 | 说明 |
---|---|
account_id 必填 | 杠杆账户的标识符。该参数出现在资源路径中,通常是除 GET accounts 外所有 Advertiser API 请求的必填参数。指定的账户必须与已认证用户关联。 Type: string Example: 18ce54d4x5t |
app_list_id 必填 | 在本次请求中所操作的 App 的 List 的引用。 Type: string Example: 28ukf |
示例请求
DELETE https://ads-api.x.com/12/accounts/18ce54d4x5t/app_lists/28ukf
示例响应
App 事件提供商配置
GET accounts/:account_id/app_event_provider_configurations¶
获取与当前账户关联的部分或全部 App 事件提供商配置(移动应用转化跟踪的核心配置)的详细信息。资源 URL
https://ads-api.x.com/11/accounts/:account_id/app_event_provider_configurations
参数
名称 | 说明 |
---|---|
account_id 必填 | 被调用(使用)的账户标识符。该值出现在资源路径中,通常是除 GET accounts 之外所有 Advertiser API 请求的必需参数。指定的账户必须与已认证用户关联。 Type: string Example: 18ce54d4x5t |
count 可选 | 指定每个请求尝试检索的记录数。 Type: int Default: 200 Min, Max: 1 , 1000 |
cursor 可选 | 指定用于获取下一页结果的游标。参见 Pagination 以了解更多信息。 Type: string Example: 8x7v00oow |
ids 可选 | 通过指定以逗号分隔的标识符列表,将响应限定为所需的配置。最多可提供 200 个 ID。 Type: string Example: 25n |
sort_by 可选 | 按受支持的属性进行升序或降序排序。参见 Sorting 以了解更多信息。 Type: string Example: created_at-asc |
with_deleted 可选 | 在请求中包含已删除的结果。 Type: boolean Default: false Possible values: true , false |
with_total_count 可选 | 在响应中包含 total_count 属性。注意:此参数与 cursor 互斥。注意:包含 total_count 的请求将适用较低的请求速率限制,当前为每 15 分钟 200 次。Type: boolean Default: false Possible values: true , false |
示例请求
GET https://ads-api.x.com/11/accounts/18ce54d4x5t/app_event_provider_configurations?ids=25n
示例响应
GET accounts/:account_id/app_event_provider_configurations/:id
检索与当前账户关联的事件提供方配置(移动应用转化跟踪的核心配置)的特定 id。资源 URL
https://ads-api.x.com/11/accounts/:account_id/app_event_provider_configurations/:id
参数
名称 | 描述 |
---|---|
account_id 必填 | 目标账户的标识符。出现在资源路径中,通常是除 GET accounts 之外所有 Advertiser API 请求的必填参数。指定的账户必须与已认证用户关联。 Type: string Example: 18ce54d4x5t |
id 必填 | 你在请求中使用的 App 事件提供方配置的引用。 Type: string Example: 25n |
with_deleted 可选 | 在请求中包含已删除的结果。 Type: boolean Default: false Possible values: true , false |
示例请求
GET https://ads-api.x.com/11/accounts/18ce54d4x5t/app_event_provider_configurations/25n
示例响应
POST accounts/:account_id/app_event_provider_configurations
创建一个与当前账户关联的 App 事件提供商配置。每个广告账户最多只能关联一个 MACT 提供商。资源 URL
https://ads-api.x.com/11/accounts/:account_id/app_event_provider_configurations
参数
名称 | 描述 |
---|---|
account_id 必填 | 目标账户的标识符。出现在资源路径中,通常是除 GET accounts 外所有 Advertiser API 请求的必填参数。指定的账户必须与已通过身份验证的用户关联。 Type: string Example: 18ce54d4x5t |
provider_advertiser_id 必填 | 来自提供方站点的广告主标识符。 Type: string Example: client1 |
示例请求
POST https://ads-api.x.com/11/accounts/18ce54d4x5t/app_event_provider_configurations?provider_advertiser_id=client1
示例响应
DELETE accounts/:account_id/app_event_provider_configurations/:id[¶]
删除当前账户所属的指定 App 事件提供方配置。资源 URL
https://ads-api.x.com/11/accounts/:account_id/app_event_provider_configurations/:id
参数
名称 | 说明 |
---|---|
account_id 必填 | 已授权账户的标识符。出现在资源路径中,通常对除 GET accounts 之外的所有 Advertiser API 请求都是必需参数。指定的账户必须与已通过身份验证的用户关联。 Type: string Example: 18ce54d4x5t |
id 必填 | 请求中所使用的 App 事件提供商配置的引用。 Type: string Example: e5g |
示例请求
DELETE https://ads-api.x.com/11/accounts/18ce54d4x5t/app_event_provider_configurations/e5g
示例响应
转化归因
GET conversion_attribution
在不写入转化事件的情况下,向 X 发起查询以检查转化归因。响应将指示 X 的归因结果。 这与 POST conversion_event endpoint 相关。 响应中将可能声明 X、TAP 或无归因。当没有 X 归因时,twitter_attribution
节点将始终存在且其值为 null
;当存在 X 归因时,该节点会如下面的示例响应所示被填充。如果声明了 TAP 归因,则会出现一个 tpn_attribution
节点并相应填充。有关更多信息,请参阅 TAP 概览。
资源 URL
https://ads-api.x.com/12/conversion_attribution
参数
名称 | 描述 |
---|---|
app_id 必填 | 与相应应用商店关联的唯一标识符。 Type: int, string 示例: 333903271 , com.vine.android |
conversion_time 必填 | 转化事件的时间,采用 ISO‑8601 时间戳格式,并包含毫秒。 Type: string 示例: 2014-05-22T02:38:28.103Z |
conversion_type 必填 | 转化事件的类型。 Type: enum 可能的取值: ACHIEVEMENT_UNLOCKED , ADDED_PAYMENT_INFO , ADD_TO_CART , ADD_TO_WISHLIST , CHECKOUT_INITIATED , CONTENT_VIEW , INSTALL , INVITE , LEVEL_ACHIEVED , LOGIN , PURCHASE , RATED , RESERVATION , RE_ENGAGE , SEARCH , SHARE , SIGN_UP , SPENT_CREDITS , TUTORIAL_COMPLETE , UPDATE |
hashed_device_id 必填 | 采用 HMAC_SHA-256 计算的 IDFA 或 AdID 的哈希值。 Type: string 示例: ABCD1234XYZ |
os_type 必填 | 该 App 的操作系统类型。 Type: enum 可能的取值: IOS , ANDROID |
click_window 可选 | 此事件的点击回溯窗口(按天)。 Type: int 默认值: 14 可能的取值: 1 , 7 , 14 , 30 |
extra_device_ids 可选 | 对传入 hashed_device_id 的设备 ID 先做 SHA1 再做 SHA256 的哈希值,以及任何其他已哈希的设备 ID。Type: string 示例: ABCD1234XYZ , DCBA4321XYZ |
non_twitter_engagement_time 可选 | 转化前最近一次非 Twitter 触达/互动的时间。 Type: string 示例: 2014-05-22T02:38:28.103Z |
non_twitter_engagement_type 可选 | 转化事件前的非 Twitter 触达/互动类型。 Type: enum 可能的取值: CLICK , VIEW |
view_through_window 可选 | 此事件的曝光回溯窗口(按天)。 Type: int 默认值: 1 可能的取值: 0 , 1 , 7 , 14 , 30 |
示例请求
GET https://ads-api.x.com/12/conversion_attribution?app_id=333903271&os_type=IOS&hashed_device_id=ABCD1234XYZ&conversion_type=INSTALL&conversion_time=2013-04-16T07:00:00.123Z&click_window=14&view_through_window=0