Search code examples
google-analyticsgoogle-apigoogle-analytics-api

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/


Solution

  • 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}