定制分析-实时分析

功能介绍

获取本APP定制分析中实时分析报告的数据,本报告是定制分析,支持维度和指标的自由组合,请详细阅读本文档说明了解使用详情。

接口

  1. https://openapi.baidu.com/rest/2.0/mtj/svc/app/getDataByKey

请求参数

此处仅列本接口特有参数,公共参数请参考报告级API说明

获取表格数据

参数名参数类型是否必须描述
methodstringanalytics/realtime/a
graphint取 0,表示获取表格数据
indexesstring维度列表,指标间逗号分隔,如:device_id,brand_id
indicatorsstring指标列表,指标间逗号分隔,如:session_count,new_user_count
userGroupint用户分群筛选,传用户分群号,如:1
customFilterstring高级筛选条件,如指定某设备的数据:{"op":"AND","items":[{"key":"device_id","op":"LIKE","val":["三星I5500(Galaxy 5)"]}]}
orderstring指标,排序,如: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%

示例

获取定制分析数据,其中维度取设备和品牌,指标取启动次数和新用户数,高级筛选指定品牌为“苹果”

请求

  1. 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

响应

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": {
  5. "offset": 0,
  6. "timeSpan": ["2018\/09\/18 - 2018\/10\/17"],
  7. "fields": ["brand_id", "device_id", "session_count", "new_user_count"],
  8. "total": 21,
  9. "end": 0,
  10. "sum": [
  11. [],
  12. [],
  13. [],
  14. []
  15. ],
  16. "pageSum": [],
  17. "items": [
  18. [
  19. [{
  20. "id": "1",
  21. "name": "苹果"
  22. }, {
  23. "id": "6940",
  24. "name": "iPhone X"
  25. }],
  26. [{
  27. "id": "1",
  28. "name": "苹果"
  29. }, {
  30. "id": "4180",
  31. "name": "iPhone 6"
  32. }],
  33. [{
  34. "id": "1",
  35. "name": "苹果"
  36. }, {
  37. "id": "5597",
  38. "name": "iPhone 7 Plus"
  39. }],
  40. [{
  41. "id": "1",
  42. "name": "苹果"
  43. }, {
  44. "id": "4258",
  45. "name": "iPhone 6s"
  46. }],
  47. [{
  48. "id": "1",
  49. "name": "苹果"
  50. }, {
  51. "id": "5596",
  52. "name": "iPhone 7"
  53. }],
  54. [{
  55. "id": "1",
  56. "name": "苹果"
  57. }, {
  58. "id": "4259",
  59. "name": "iPhone 6s Plus"
  60. }],
  61. [{
  62. "id": "1",
  63. "name": "苹果"
  64. }, {
  65. "id": "6939",
  66. "name": "iPhone 8 Plus"
  67. }],
  68. [{
  69. "id": "1",
  70. "name": "苹果"
  71. }, {
  72. "id": "6938",
  73. "name": "iPhone 8"
  74. }],
  75. [{
  76. "id": "1",
  77. "name": "苹果"
  78. }, {
  79. "id": "4181",
  80. "name": "iPhone 6 Plus"
  81. }],
  82. [{
  83. "id": "1",
  84. "name": "苹果"
  85. }, {
  86. "id": "3888",
  87. "name": "iPhone 5s"
  88. }],
  89. [{
  90. "id": "1",
  91. "name": "苹果"
  92. }, {
  93. "id": "5080",
  94. "name": "iPhone SE"
  95. }],
  96. [{
  97. "id": "1",
  98. "name": "苹果"
  99. }, {
  100. "id": "3889",
  101. "name": "iPad mini 2G(WIFI)"
  102. }],
  103. [{
  104. "id": "1",
  105. "name": "苹果"
  106. }, {
  107. "id": "4264",
  108. "name": "iPad Air 2 (WiFi)"
  109. }],
  110. [{
  111. "id": "1",
  112. "name": "苹果"
  113. }, {
  114. "id": "5692",
  115. "name": "ipad (第五代)"
  116. }],
  117. [{
  118. "id": "1",
  119. "name": "苹果"
  120. }, {
  121. "id": "3372",
  122. "name": "iPhone 5"
  123. }],
  124. [{
  125. "id": "1",
  126. "name": "苹果"
  127. }, {
  128. "id": "7073",
  129. "name": "Ipad"
  130. }],
  131. [{
  132. "id": "1",
  133. "name": "苹果"
  134. }, {
  135. "id": "3477",
  136. "name": "iPad mini(WIFI)"
  137. }],
  138. [{
  139. "id": "1",
  140. "name": "苹果"
  141. }, {
  142. "id": "3891",
  143. "name": "iPad Air(WIFI)"
  144. }],
  145. [{
  146. "id": "1",
  147. "name": "苹果"
  148. }, {
  149. "id": "5079",
  150. "name": "iPad Pro 12.9-inch (WiFi)"
  151. }],
  152. [{
  153. "id": "1",
  154. "name": "苹果"
  155. }, {
  156. "id": "4622",
  157. "name": "iPad Air 2 WLAN"
  158. }]
  159. ],
  160. [
  161. [12598, 190],
  162. [7362, 106],
  163. [7053, 179],
  164. [4529, 147],
  165. [3434, 156],
  166. [2181, 119],
  167. [1507, 98],
  168. [1177, 64],
  169. [563, 52],
  170. [515, 7],
  171. [326, 18],
  172. [12, 3],
  173. [9, 2],
  174. [9, 3],
  175. [6, 2],
  176. [5, 3],
  177. [4, 2],
  178. [3, 3],
  179. [2, 2],
  180. [2, 2]
  181. ],
  182. [],
  183. []
  184. ]
  185. }
  186. }