简体   繁体   中英

Get multiple user's demographics in one call from Google Analytics?

I understand that I can do something like as follows:

$optParams = array(
      'dimensions' => 'ga:userAgeBracket,ga:userGender'
);

return $analytics->data_ga->get(
      'ga:' . $profileId,
      '7daysAgo',
      'today',
      'ga:sessions',
      $optParams
);

Is there any way to do this for many Google Analytics profiles at once? I have not been able to find any documentation on this.

The call will return results for many users at once (to wit, for all visits within the last seven days), so you're already there.

It is actually the opposite that is impossible - you cannot query demographics for single users, since Google will not show demographic data for small result sets (I think this is a privacy issue, if you get enough information on a single user it might be possible to identify him).

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