Getting Top Content from Google Analytics

Discussion in 'Google API' started by sarahk, May 6, 2009.

  1. #1
    I've just downloaded some code from http://www.swis.nl/ga/ and am making a great start in writing some custom reports for a client.

    I've come unstuck making my own function to get the Top Content. It's fine from the site but I want my code to retrieve the "title" of the content and that's a manual process currently.

    Currently I have
        /**
        * Get unique pageviews for given period (sk experimental)
        * 
        */    
        public function getTopContent(){
                                    
            return $this->getData(array( 'dimensions' => 'ga:pagePath',
                                         'metrics'    => 'ga:pageviews',
                                         'sort'       => 'ga:visits'));
        }
    
    PHP:
    but it falls over.

    any hints on what the dimensions, metrics and sort really should be?
     
    sarahk, May 6, 2009 IP