Can I request multiple Metrics using the Data API PHP client library?
ex)
date for dimension, sessions and totalUsers for metric for Data API request
My Answer:
Yes, you can request multiple metrics using the Data API PHP client library. You can specify the metrics you want to retrieve in the request by including them in the metrics parameter. For example, if you want to retrieve the date for dimension, sessions, and totalUsers for metric in a Data API request, you can include them like this:
php
$analytics->data_ga->get(
'ga:' . $profileId,
'2019-01-01',
'2019-01-31',
'ga:sessions,ga:totalUsers',
array(
'dimensions' => 'ga:date'
)
);
This will retrieve the date for dimension, sessions, and totalUsers for metric in the specified date range.
Rate this post
3 of 5 based on 7333 votesComments