Open GoogleCodeExporter opened 9 years ago
I had the exact same problem... thanks a lot!
Original comment by rafael.f...@gmail.com
on 11 Mar 2010 at 6:28
Agreed. It's perfectly valid to omit dimensions for aggregate values. I
patched it by changing the block at 129 to this:
if( !empty($dimensions) ) {
$parameters['dimensions'] = 'ga:'.$dimensions;
} else {
$parameters['dimensions'] = '';
}
The problem is that the function doesn't check to see if the string is empty,
so it always prepends 'ga:' to a non-array dimension.
Original comment by clavi...@gmail.com
on 8 Jan 2011 at 11:16
Here's an example if you want to test it out:
$ga->requestReportData(1234567890, null, array('bounces', 'entrances', 'exits',
'newVisits', 'pageviews', 'timeOnPage', 'timeOnSite', 'visitors', 'visits'),
null, null, $start_date, $end_date);
Original comment by clavi...@gmail.com
on 8 Jan 2011 at 11:17
for those who are new to PHP, the block starting at line 117 and ends at around
line 129 should be deleted and replaced with:
if(is_array($dimensions))
{
$dimensions_string = '';
foreach($dimensions as $dimesion)
{
$dimensions_string .= ',ga:' . $dimesion;
}
$parameters['dimensions'] = substr($dimensions_string,1);
}
else
{
if($dimensions != '')
{
$parameters['dimensions'] = 'ga:'.$dimensions;
}
else
{
$parameters['dimensions'] = '';
}
}
Original comment by maartenb...@gmail.com
on 5 May 2011 at 11:10
Thanks for this!
Original comment by i...@cre8websolutions.be
on 15 Jun 2012 at 1:34
Original issue reported on code.google.com by
max.c...@gmail.com
on 7 Aug 2009 at 4:43Attachments: