Analytics API returns wrong users count when fetching paginated result

℡╲_俬逩灬. 提交于 2019-12-12 02:35:24

问题


Trying to get data using GA API for java like it's described in the devguide.

Dimensions:

  • ga:pagePath
  • ga:date
  • ga:country
  • ga:hostname
  • ga:userType

Metrics:

  • ga:pageviews
  • ga:sessions
  • ga:users
  • ga:uniquePageviews
  • ga:bounceRate
  • ga:pageValue
  • ga:exitRate

I'm querying for a single date, max-result = 10000. There are more than 10k rows in result, so I'm querying in a loop using start-index.

The problem with that query is that in the resulting data number of users is ~3 times greater than number of sessions. When I'm making a simpler query (ga:users, ga:sessions broken by ga:date for the same date) the ration seems valid -- users/sessions = 0.8

Source code is available in a repository

Any ideas on how to get valid users count with that more complex query?


回答1:


Sessions (an odd metric in GA) are only counted on the first hit of the sessions i.e. the landing page. When viewing page-level data, if a page is not a landing page, do not be surprised to see 0 sessions with many pageviews or users.

If you want a detailed explanation about this, read: http://help.analyticsedge.com/googleanalytics/misunderstood-metrics-sessions-for-pages/



来源:https://stackoverflow.com/questions/43144819/analytics-api-returns-wrong-users-count-when-fetching-paginated-result

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!