1
votes

In google analytics i want to get details of Audience->User explorer through google analytics API (python API). I am following the below link https://developers.google.com/analytics/devguides/reporting/core/v3/common-queries and using the same syntax, but i am unable to get the required data.Kindly help what will be "metrics and dimentions" to get all visited user id and ther individual details.

def get_top_keywords(service, profile_id):
return service.data().ga().get(
  ids='ga:' + profile_id,
  start_date='2016-07-14',
  end_date='today',
  metrics='ga:users,ga:pageviews',
  dimensions='ga:pagePath').execute()
1

1 Answers

1
votes

Google Analytics does not expose user id and client id through the API. So by default you cannot recreate the user explorer report through the API.

You'd have to store the client or user id in a custom dimension, and even then I'm not sure it would be possible to get the same kind of report, let alone in a single query (and with some data, like session start/end time, I do not think there is a way to get at the data at all).

So there is currently not combination of dimensions and metrics that would give you a report similar to the user explorer report.