上传广告收入事件
传输广告收入信息。
使用示例:您可以使用 Post API 传输与每个应用用户相关的广告点击收入信息。
通过 Post API 接收的购买事件用于计算所有指标,也可在漏斗和分群中使用。
事件属性可以通过参数或请求体传递。 当您在请求体中传递数据时,应将.csv添加到请求的URL中。 要了解更多信息,请查看示例请求。
要将事件绑定到用户,您需要在API请求中使用以下字段之一:
profile_idappmetrica 设备 ID
注意
Post API 有数据加载限制。 要了解更多信息,请查看限制。
请求格式
POST https://api.boost.yandex.com/日志/v1/导入/广告收入
? post_api_key=<string>
& application_id=<int>
& profile_id=<string>
& appmetrica_device_id=<int>
& event_timestamp=<int>
& revenue=<decimal>
& currency=<enum>
& ad_type=<enum>
& [ad_network=<string>]
& [ad_unit_id=<int>]
& [ad_unit_name=<string>]
& [ad_placement_id=<int>]
& [ad_placement_name=<string>]
& [precision=<enum>]
& [payload=<string>]
& [session_type=<string>]
& [ios_ifa=<string>]
& [ios_ifv=<string>]
& [google_aid=<string>]
& [windows_aid=<string>]
& [os_name=<string>]
& [os_version=<string>]
& [device_manufacturer=<string>]
& [device_model=<string>]
& [device_type=<string>]
& [device_locale=<string>]
& [app_version_name=<string>]
& [app_package_name=<string>]
& [connection_type=<string>]
& [operator_name=<string>]
& [mcc=<int>]
& [mnc=<int>]
& [device_ipv6=<string>]
|
|
用于数据上传的令牌。 您可以在应用的 设置 部分获取它。 |
|
|
应用在 Analytics module 中的唯一数字标识符。 |
|
|
用户个人资料 ID。 Post API 仅允许您上传先前通过 SDK 发送的标识符的数据。 注意 不要传递带有 |
|
|
Analytics module 设置的设备唯一标识符的哈希。 Post API 仅允许您上传先前通过 SDK 发送的标识符的数据。 注意 不要传递 |
|
|
事件的时间,格式为 Unix time。 使用 Post API,您只能在事件日期(event_timestamp)与上传日期之间的差异不超过 14 天时上传事件。 API 期望以秒为单位的值。 |
|
|
每次广告展示的收入。 收入金额,格式为 decimal(10.8)(小数点前 10 位、小数点后 8 位的十进制小数)。 |
|
|
购买的货币。 可用货币列表. |
|
|
广告类型。 可用值: |
|
|
广告网络名称。 |
|
|
广告网络中的单元 ID。 |
|
|
广告网络中的单元名称。 |
|
|
广告网络中的广告位 ID。 |
|
|
广告网络中的广告位名称。 |
|
|
数据传输的精度。 例如, |
|
|
任意负载:以键值对形式呈现的附加信息。 最大大小为 30 KB。 如果值超过此限制,Analytics module 将截断它。 |
|
|
会话类型。 可能的值:
Default value is |
|
|
设备的 IFA,格式为从设备接收的格式。 |
|
|
应用的 IFV,格式为从设备接收的格式。 |
|
|
设备的 Google AID,格式为从设备接收的格式。 |
|
|
设备的 Windows AID,格式为从设备接收的格式。 |
|
|
用户设备上的操作系统: |
|
|
用户设备上的操作系统版本。 |
|
|
Analytics 服务检测到的设备制造商(例如,Apple 或 Samsung)。 |
|
|
Analytics 服务检测到的设备型号(例如,Galaxy S6)。 |
|
|
Analytics 服务检测到的设备类型。 可能的值: |
|
|
设备上的语言。 |
|
|
开发者指定的应用版本格式。 |
|
|
Android 的包名,或 iOS 的 Bundle ID(例如,ru.yandex.metro)。 |
|
|
连接类型。 可能的值: |
|
|
移动运营商名称。 |
|
|
移动国家代码。 |
|
|
移动网络代码。 |
|
|
事件时的 IP 地址,格式为 IPv6。 例如,2a02:6b8::40c:6676:baff:fea6:53d8, ::ffff:5.255.232.147。 |
Response codes
| Code | 描述 |
|---|---|
| 200 | 数据已成功上传。 |
| 403 | 请求缺少授权头,或者指定了无效的令牌。 |
| 400 | 请求中缺少一个或多个必需参数。 |
示例请求
POST /logs/v1/import/adrevenue.csv?post_api_key=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ012 HTTP/1.1
Host: api.boost.yandex.com
Content-Length: 540i
Connection: close
application_id,profile_id,appmetrica_device_id,event_timestamp,revenue,currency,ad_type,ad_network,ad_unit_id,ad_unit_name,ad_placement_id,ad_placement_name,precision,payload,session_type,ios_ifa,ios_ifv,google_aid,windows_aid,os_name,os_version,device_manufacturer,device_model,device_type,device_locale,app_version_name,app_package_name,connection_type,operator_name,mcc,mnc,device_ipv6
1234567890,1234567890abcdef,1757762239877245682,1689943892,0.0001,usd,banner,some_network_name,0987654321,some_unit_name,12345000,some_placement_name,estimated,"{""key"":""value_1""}",foreground,123456abcde,54321edcba,098765abcde,567890abcde,ios,16.6,Apple,iPhone14Pro,phone,en_US,some_version_name,some_package_name,wifi,MegaFon,250,2,2a02:6b8::40c:6676:baff:fea6:53d8
POST /logs/v1/import/adrevenue.csv?post_api_key=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ012&application_id=1234567890&profile_id=1234567890abcdef&appmetrica_device_id=1757762239877245682&event_timestamp=1689943892&revenue=0.0001¤cy=usd&ad_type=banner&ad_network=some_network_name&ad_unit_id=0987654321&ad_unit_name=some_unit_name&ad_placement_id=12345000&ad_placement_name=some_placement_name&precision=estimated&payload="{""key"":""value_1""}"&session_type=foreground&ios_ifa=123456abcde&ios_ifv=54321edcba&google_aid=098765abcde&windows_aid=567890abcde&os_name=ios&os_version=16.6&device_manufacturer=Apple&device_model=iPhone14Pro&device_type=phone&device_locale=en_US&app_version_name=some_version_name&app_package_name=some_package_name&connection_type=wifi&operator_name=MegaFon&mcc=250&mnc=2&device_ipv6=2a02:6b8::40c:6676:baff:fea6:53d8 HTTP/1.1
Host: api.boost.yandex.com
Content-Length: 0
Connection: close
其他 Post API 方法
如果您没有找到所需答案,可以通过反馈表单提交您的问题。 请尽可能详细地描述问题。 如果可能,请附上截图。