Skip to content

事件上报

/v1/report/track-event

text
小游戏:支持
iOS:支持
Android:支持
服务端:支持

功能描述

事件上报

请求方式

POST

请求参数

属性类型是否必选说明
app_tokenstring应用token,从后台获取
event_tokenstring事件token,从后台获取
device_infoobject设备信息
device_tokenstring设备标识(从初始化接口获取)
user_infoobject用户信息
revenue_dataobject付费数据
action_dataobject行为数据
report_jsonstring其他上报数据(JSON格式)
referrerstring数据来源

device_info

属性类型是否必选说明
osstring系统类型(android、ios)
modelstring设备型号
uastringuser agent
oaidstringoaid
ipstringip地址(ipv4)

user_info

属性类型说明
user_idint用户ID

revenue_data

属性类型说明
revenueint收入金额(单位:分)
currencystring货币单位(例如:CNY)

action_data

属性类型说明
currentstring当前行为/页面标识
nextstring下一个行为/页面标识

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