实时分析
优质
小牛编辑
134浏览
2023-12-01
功能介绍
获取本APP定制分析中实时分析报告的数据,本报告是定制分析,支持维度和指标的自由组合,请详细阅读本文档说明了解使用详情。
接口
https://openapi.baidu.com/rest/2.0/mtj/svc/app/getDataByKey
请求参数
此处仅列本接口特有参数,公共参数请参考报告级API说明
获取表格数据
参数名 | 参数类型 | 是否必须 | 描述 |
---|---|---|---|
method | string | 是 | analytics/realtime/a |
graph | int | 是 | 取 0,表示获取表格数据 |
indexes | string | 是 | 维度列表,指标间逗号分隔,如:device_id,brand_id |
indicators | string | 是 | 指标列表,指标间逗号分隔,如:session_count,new_user_count |
userGroup | int | 否 | 用户分群筛选,传用户分群号,如:1 |
customFilter | string | 否 | 高级筛选条件,如指定某设备的数据:{"op":"AND","items":[{"key":"device_id","op":"LIKE","val":["三星I5500(Galaxy 5)"]}]} |
order | string | 否 | 指标,排序,如:session_count,desc |
维度
维度名 | 描述 |
---|---|
brand_id | 安装该APP的设备品牌 |
device_id | 安装该APP的设备型号 |
os_version | 安装该APP的操作系统版本号 |
screen_id | 安装该APP的设备的屏幕分辨率 |
isp_id | 安装该APP的设备的运营商 |
version_id | 用户启动该APP时的版本 |
new_visitor | 指新用户、老用户、启动用户 |
channel_id | 用户下载该APP的渠道 |
province_id | 用户打开该APP时所在的省 |
country_id | 用户打开该APP时所在的国家 |
page_id | 被用户访问的页面 |
stat_date | 用户打开该APP时所在的日期(以服务器接收日志时间为准) |
stat_hour | 用户打开该APP时所在的时段(以服务器接收日志时间为准) |
event_id | 事件的唯一标识 |
指标
指标名 | 描述 |
---|---|
session_count | 启动过该APP的次数 |
new_user_count | 第一次启动该APP的用户的数量(以独立设备为判断标准) |
new_user_ratio | 新用户占比=新用户数/启动用户数*100% |
old_user_count | 非首次启动该APP的用户的数量(以独立设备为判断标准) |
old_user_ratio | 老用户占比=老用户数/启动用户数*100% |
user_count | 启动过该APP的用户的数量(以独立设备为判断标准) |
average_session_time | 平均每次使用该APP的时长 |
average_user_time | 平均每个用户使用该APP的总计时长 |
average_user_session_count | 人均启动次数=启动次数/启动用户数 |
event_count | 事件被触发的次数 |
average_event_time | 事件每次持续的平均时长 |
page_count | 页面被访问的次数 |
average_page_stay_time | 用户访问当前页面的平均停留时长 |
exit_count | 从当前页面离开该APP的次数 |
page_leave_ratio | 页面退出率=页面退出数/页面访问次数*100% |
示例
获取定制分析数据,其中维度取设备和品牌,指标取启动次数和新用户数,高级筛选指定品牌为“苹果”
请求
https://openapi.baidu.com/rest/2.0/mtj/svc/app/getDataByKey?access_token=[ACCESS_TOKEN]&key=[APP_KEY]&method=analytics/realtime/a&graph=0&customFilter={"op":"AND","items":[{"key":"brand_id","op":"LIKE","val":["苹果"]}]}&userGroup=0&order=session_count,desc&indexes=brand_id,device_id&start-date=20170101000000&end-date=20170101232359&metrics=session_count,new_user_count
响应
{
"status": 0,
"msg": "",
"data": {
"offset": 0,
"timeSpan": ["2018\/09\/18 - 2018\/10\/17"],
"fields": ["brand_id", "device_id", "session_count", "new_user_count"],
"total": 21,
"end": 0,
"sum": [
[],
[],
[],
[]
],
"pageSum": [],
"items": [
[
[{
"id": "1",
"name": "苹果"
}, {
"id": "6940",
"name": "iPhone X"
}],
[{
"id": "1",
"name": "苹果"
}, {
"id": "4180",
"name": "iPhone 6"
}],
[{
"id": "1",
"name": "苹果"
}, {
"id": "5597",
"name": "iPhone 7 Plus"
}],
[{
"id": "1",
"name": "苹果"
}, {
"id": "4258",
"name": "iPhone 6s"
}],
[{
"id": "1",
"name": "苹果"
}, {
"id": "5596",
"name": "iPhone 7"
}],
[{
"id": "1",
"name": "苹果"
}, {
"id": "4259",
"name": "iPhone 6s Plus"
}],
[{
"id": "1",
"name": "苹果"
}, {
"id": "6939",
"name": "iPhone 8 Plus"
}],
[{
"id": "1",
"name": "苹果"
}, {
"id": "6938",
"name": "iPhone 8"
}],
[{
"id": "1",
"name": "苹果"
}, {
"id": "4181",
"name": "iPhone 6 Plus"
}],
[{
"id": "1",
"name": "苹果"
}, {
"id": "3888",
"name": "iPhone 5s"
}],
[{
"id": "1",
"name": "苹果"
}, {
"id": "5080",
"name": "iPhone SE"
}],
[{
"id": "1",
"name": "苹果"
}, {
"id": "3889",
"name": "iPad mini 2G(WIFI)"
}],
[{
"id": "1",
"name": "苹果"
}, {
"id": "4264",
"name": "iPad Air 2 (WiFi)"
}],
[{
"id": "1",
"name": "苹果"
}, {
"id": "5692",
"name": "ipad (第五代)"
}],
[{
"id": "1",
"name": "苹果"
}, {
"id": "3372",
"name": "iPhone 5"
}],
[{
"id": "1",
"name": "苹果"
}, {
"id": "7073",
"name": "Ipad"
}],
[{
"id": "1",
"name": "苹果"
}, {
"id": "3477",
"name": "iPad mini(WIFI)"
}],
[{
"id": "1",
"name": "苹果"
}, {
"id": "3891",
"name": "iPad Air(WIFI)"
}],
[{
"id": "1",
"name": "苹果"
}, {
"id": "5079",
"name": "iPad Pro 12.9-inch (WiFi)"
}],
[{
"id": "1",
"name": "苹果"
}, {
"id": "4622",
"name": "iPad Air 2 WLAN"
}]
],
[
[12598, 190],
[7362, 106],
[7053, 179],
[4529, 147],
[3434, 156],
[2181, 119],
[1507, 98],
[1177, 64],
[563, 52],
[515, 7],
[326, 18],
[12, 3],
[9, 2],
[9, 3],
[6, 2],
[5, 3],
[4, 2],
[3, 3],
[2, 2],
[2, 2]
],
[],
[]
]
}
}