Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to GET data for multiple profile_ids in Google Analytics Reporting API?

Is there a way to fetch information for multiple ids in a single GA Reporting API query? See here for reference to the tool I am using: http://ga-dev-tools.appspot.com/explorer/

like image 826
Jesse Atkinson Avatar asked Jun 16 '14 20:06

Jesse Atkinson


People also ask

How do I extract raw data from Google Analytics?

The easiest way to export data is to get it directly from the GA panel. After selecting the report, click on the export data option at the top right-hand corner. Next, you have to select the file format from the drop-down menu. You can choose between CSV, Excel(xlsx), PDF or you can directly export to Google Sheets.


1 Answers

Tthe Google Analtyics core Reporting API is a little confusing. Core Reporting API - Reference Guide - Ids calls the Query Parameter ids but it is in fact singular. You can only send one id at a time.

Anwser: There is no way to send more then one view (profile_id) to the Core reporting api as a single request. You will need to loop over your request and send it multiple times.

Example:

https://www.googleapis.com/analytics/v3/data/ga?ids=ga:34896749&dimensions=ga:date&metrics=ga:entrances&start-date=2014-05-12&end-date=2014-05-22&oauth_token={OauthToken}
https://www.googleapis.com/analytics/v3/data/ga?ids=ga:34896744&dimensions=ga:date&metrics=ga:entrances&start-date=2014-05-12&end-date=2014-05-22&oauth_token={OauthToken}
like image 125
DaImTo Avatar answered Oct 07 '22 19:10

DaImTo