转化事件

POST conversion_event

记录移动评估转化事件。响应会指明 Twitter 或 Twitter 受众平台 (TAP) 归因。

这关系到 GET conversion_attribution 端点。

将在响应中声明 Twitter、TAP 或无归因。没有 Twitter 归因时,将始终出现值为 nulltwitter_attribution 节点(请参见以下响应示例)。如果已声明 TAP 归因,将出现 tpn_attribution 节点并进行相应填充。参阅 TAP 概述了解更多信息。

有几个可选参数,可用于设置与每个转化事件关联的元数据。此元数据对归因计算没有影响。

资源 URL

https://ads-api.twitter.com/10/conversion_event

参数

名称 说明
app_id
必需

相应应用商店的唯一标识符。

类型:int、string

示例:333903271com.vine.android

conversion_time
必需

转化事件的时间采用 ISO-8601 时间戳格式,后面附加毫秒数。

类型:string

示例:2014-05-22T02:38:28.103Z

conversion_type
必需

转化事件的类型。

类型:enum

可能值:PURCHASESIGN_UPINSTALLRE_ENGAGEUPDATETUTORIAL_COMPLETERESERVATIONADD_TO_CARTADD_TO_WISHLISTLOGINCHECKOUT_INITIATEDSEARCHLEVEL_ACHIEVEDACHIEVEMENT_UNLOCKEDCONTENT_VIEWSHAREINVITEADDED_PAYMENT_INFOSPENT_CREDITSRATED

hashed_device_id
必需

使用 HMAC_SHA-256 哈希处理的 IDFA 或 AdID。

类型:string

示例:ABCD1234XYZ

os_type
必需

应用的 OS 类型。

类型:enum

可能值:IOSANDROID

click_window
可选

此事件的点击窗口(以天为单位)。

类型:int

注意click_window 必须大于或等于 view_through_window

默认值:14
可能值:171430
device_ip_address
可选

发生转化事件时设备的 IPv4 或 IPv6 地址。

类型:string

示例:192.133.78.1

level
可选

与此事件关联的级别。

类型:int

示例:2
non_twitter_engagement_time
可选

转化前最后一次非 Twitter 互动的时间。

类型:string

示例:2014-05-22T02:38:28.103Z

non_twitter_engagement_type
可选

转化事件前非 Twitter 互动的类型。

类型:enum

可能值:CLICKVIEW

number_items
可选

与该事件关联的项目数。

类型:int

示例:2
price_currency
可选

应该为 ISO 4217 代码,指示与此事件关联的货币。

类型:字符串

示例:EURUSDJPY
price_micro
可选

与该事件关联的价格金额(以微观数字表示)。

类型:int

示例:123450000
user_payment_info
可选

一个布尔值,指示用户的付款信息是否存储在与此事件关联的应用中。

类型:bool

可能值:truefalse
view_through_window
可选

通过窗口查看此事件(以天为单位)。

注意

click_window 必须大于或等于 view_through_window

类型:int

默认值:1
可能值:0171430

请求示例

https://ads-api.twitter.com/10/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

响应示例

{
  "data": {
    "conversion_value_micro": 0,
    "view_through_window": 1,
    "tpn_attribution": null,
    "conversion_time": "2017-01-21T01:14:00.602Z",
    "click_window": 30,
    "limit_ad_tracking": false,
    "event_metadata": null,
    "non_twitter_engagement_type": null,
    "conversion_type": "INSTALL",
    "partner_client_id": "com.appname contact id",
    "app_id": "com.appname",
    "hashed_device_id": "lke1GZa3AseB343ZcCQq7svfHzLfuSqyYnE+Rf49MOI=",
    "twitter_attribution": {
      "country_code": "US",
      "engagement_time": "2017-01-21T01:13:00.602Z",
      "engagement_type": "CLICK",
      "attribution_type": "PROMOTED",
      "promoted_properties": {
        "campaign_id": "4ns44",
        "line_item_id": "3x44d",
        "publisher_app_id": "333903271"
        "account_id":"18ce11e3egb",
        "line_item_objective": "APP_INSTALLS",
        "campaign_name": null
      },
      "tweet_id": "11434635565377600"
    },
    "os_type": "ANDROID",
    "non_twitter_engagement_time": null
  },
  "request": {
    "params": {
      "version_number": "1",
      "app_id": "com.appname",
      "conversion_type": "INSTALL",
      "os_type": "ANDROID",
      "hashed_device_id": "lke1GZa3AseB343ZcCQq7svfHzLfuSqyYnE+Rf49MOI=",
      "conversion_time": "2017-01-21T01:14:00.602Z",
      "click_window": "30",
      "view_through_window": "1",
      "limit_ad_tracking": "false"
    }
  }
}