简体   繁体   中英

Can we fetch all users and session from google analytics using Reporting API in PHP

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM