深色模式
事件上报
/v1/report/track-event
text
小游戏:支持
iOS:支持
Android:支持
服务端:支持
功能描述
事件上报
请求方式
POST
请求参数
属性 | 类型 | 是否必选 | 说明 |
---|---|---|---|
app_token | string | 是 | 应用token,从后台获取 |
event_token | string | 是 | 事件token,从后台获取 |
device_info | object | 是 | 设备信息 |
device_token | string | 否 | 设备标识(从初始化接口获取) |
user_info | object | 否 | 用户信息 |
revenue_data | object | 否 | 付费数据 |
action_data | object | 否 | 行为数据 |
report_json | string | 否 | 其他上报数据(JSON格式) |
referrer | string | 否 | 数据来源 |
device_info
属性 | 类型 | 是否必选 | 说明 |
---|---|---|---|
os | string | 是 | 系统类型(android、ios) |
model | string | 是 | 设备型号 |
ua | string | 是 | user agent |
oaid | string | 否 | oaid |
ip | string | 否 | ip地址(ipv4) |
user_info
属性 | 类型 | 说明 |
---|---|---|
user_id | int | 用户ID |
revenue_data
属性 | 类型 | 说明 |
---|---|---|
revenue | int | 收入金额(单位:分) |
currency | string | 货币单位(例如:CNY) |
action_data
属性 | 类型 | 说明 |
---|---|---|
current | string | 当前行为/页面标识 |
next | string | 下一个行为/页面标识 |
report_json
重要
report_json 内部结构必须为key-value,且不允许有多个层级。
格式举例:
json
{
"key1": "value1",
"key2": "value2"
}
请求示例
json
{
"app_token": "app_token",
"event_token": "event_token",
"device_info": {
"ip": "127.0.0.1",
"ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
"os": "ios",
"oaid": "xxxx-xxxx-xxxx-xxxx",
"model": "iPhone15,3"
},
"device_token": "device_token",
"user_info": {
"user_id":0
},
"revenue_data": {
"revenue":0,
"currency":""
},
"action_data": {
"current":"index",
"next":"login"
},
"report_json":"",
"referrer":""
}
返回值
json
{
"code": 0,
"message": "",
"data": {
"result": true,
"device_token": "device_token"
}
}