我们是否可以使用PHP中的Reporting API从Google Analytics中获取所有用户和会话

I want to fetch all users, session and other tables data from google analytic account.

I check the GA Reporting API, But it provides value in statistics format like total user, session count etc.

Is there any way to fetch the GA data in list format like.

  • List of all users including all fields.
  • List of all session including all fields.
  • Data from all the table available in this link

I also check the GA DEV TOOL, but it provides only counts, not the details.

The Google Analytics Core reporting API gives you a wide range of dimensions and metrics that you can select out of your Google analytics account.

The format of requests is

Authorization: Bearer {oauth2-token}

GET https://www.googleapis.com/analytics/v3/data/ga
  ?ids=ga:12345
  &start-date=2008-10-01
  &end-date=2008-10-31
  &metrics=ga:sessions,ga:bounces

There are some limitations that you should be aware of. You are limited to 7 dimensions and 12 metrics per request. You are limited to 10000 requests per day pre profile.

An alternative would be to get a Premium Google analytics account where Google will help you extract your data into bigquery making analysis easer.

As to what format you extract it in that is up to you the API returns the data as JSon, you will have to format it into your list.