I think you are looking for filters. You can use the filter parameter to limit the result set. Google also says this is a good way to handle large data sets. That way, essentially, you can simply hook on one specific path you want with a filter, or you can grab them all and organize them accordingly.
$path = "/path-goes-here"; $filter = "pagePath == '$path'"; $ga->requestReportData(ga_profile_id,array('pagePath'), array('pageviews','uniquePageviews'),'',$filter); $result = $ga->getResults(); if (count($result)) { $result = array('pageviews' => $result[0]->getPageviews(), 'unique_pageviews' => $result[0]->getUniquePageviews() ); } print_r($result); $ga->requestReportData(ga_profile_id,array('pagePath'),array('pageviews','uniquePageviews')); $results = array(); foreach($ga->getResults() as $result) { $results[$result->getPagePath()] = array('pageviews' => $result->getPageviews(), 'unique_pageviews' => $result->getUniquePageviews() ); } if(array_key_exists($path,$results)) { print_r($results[$path]); }
Kelly source share