I use the Yii framework with the JGoogleAPI extension as follows:
$service = Yii::app()->JGoogleAPI->getService('Analytics');
$optParams = array(
'metrics' => 'ga:visits',
'max-results' => '1'
);
$gaData =
$service->data_ga->get(
'ga:XXXXXXX',
'2012-12-19',
'2012-12-21',
'ga:visits',
$optParams
);
If I had 10 hits on the 19th, 20 hits on the 20th, and 30 hits on the 21st, this query gives me: 30 + 20 + 10 = 60. However, I want ONE query that returns rows for each day.
Ie, not this:
array[0] = 60
But rather this:
array[0] = 10
array[1] = 20
array[2] = 30
Any idea how to do that?