页面分析

功能介绍

获取页面分析报告数据,包括表格详情数据与趋势数据,所获取数据与 https://mtj.baidu.com 中报告数据一致

接口

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

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

获取表格数据

参数名参数类型是否必须描述
methodstringvisit/page/a
metricsstring指标列表,指标间逗号分隔

获取趋势数据

参数名参数类型是否必须描述
methodstringvisit/page/f
metricsstring指标,只支持单个指标

指标

指标名描述适用接口
pv_count访问次数visit/page/a,visit/page/f
pv_ratio访问次数占比visit/page/a
average_stay_time平均停留时间visit/page/a,visit/page/f
stay_time_ratio停留时间占比visit/page/a
bounce_ratio页面跳出率visit/page/a,visit/page/f

示例

获取页面分析数据

请求

  1. https://openapi.baidu.com/rest/2.0/mtj/svc/app/getDataByKey?access_token=[ACCESS_TOKEN]&key=[APPKEY]&method=visit/page/a&start-date=20171107000000&end-date=20171108232359&metrics=pv_count,pv_ratio

响应

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": {
  5. "offset": 0,
  6. "timeSpan": [
  7. "2017/11/07 - 2017/11/08"
  8. ],
  9. "fields": [
  10. "visit_page_title",
  11. "visit_page_alias_title",
  12. "pv_count",
  13. "pv_ratio",
  14. ],
  15. "total": 2,
  16. "sum": [
  17. [
  18. 17862,
  19. 100,
  20. ],
  21. []
  22. ],
  23. "pageSum": [],
  24. "items": [
  25. [
  26. [
  27. {
  28. "pageName": "searchindex",
  29. "pageId": "1307*******698719220",
  30. "pageAlias": "搜索页"
  31. }
  32. ],
  33. [
  34. {
  35. "pageName": "logsHomePagePv",
  36. "pageId": "38326******3786092",
  37. "pageAlias": "2.0首页精彩推荐tab"
  38. }
  39. ],
  40. ],
  41. [
  42. [
  43. 5734,
  44. 32.1,
  45. ],
  46. [
  47. 4750,
  48. 26.59,
  49. ]
  50. ],
  51. [],
  52. []
  53. ]
  54. }
  55. }