问题
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