I'm trying to work out how to get the top 5 pages from my Google Analytics Project API in PHP. So far I've made the following code, but it doesn't appear to work - any ideas?
private function getTopPages($profileId) {
$optParams = array(
'sort' => 'ga:pageviews',
'max-results' => '5');
return $this->analytics->data_ga->get(
'ga:' . $profileId,
'2012-09-01',
'2012-09-30',
'ga:pagePath',
$optParams);
}