Google_DataGaServiceResource

The "ga" collection of methods.

Defined (1)

The class is defined in the following location(s).

/google-api-php-client/api-code/contrib/Google_AnalyticsService.php  
  1. class Google_DataGaServiceResource extends Google_ServiceResource { 
  2.  
  3. /** 
  4. * Returns Analytics data for a view (profile). (ga.get) 
  5. * @param string $ids Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. 
  6. * @param string $start_date Start date for fetching Analytics data. All requests should specify a start date formatted as YYYY-MM-DD. 
  7. * @param string $end_date End date for fetching Analytics data. All requests should specify an end date formatted as YYYY-MM-DD. 
  8. * @param string $metrics A comma-separated list of Analytics metrics. E.g., 'ga:visits, ga:pageviews'. At least one metric must be specified. 
  9. * @param array $optParams Optional parameters. 
  10. * @opt_param string dimensions A comma-separated list of Analytics dimensions. E.g., 'ga:browser, ga:city'. 
  11. * @opt_param string filters A comma-separated list of dimension or metric filters to be applied to Analytics data. 
  12. * @opt_param int max-results The maximum number of entries to include in this feed. 
  13. * @opt_param string segment An Analytics advanced segment to be applied to data. 
  14. * @opt_param string sort A comma-separated list of dimensions or metrics that determine the sort order for Analytics data. 
  15. * @opt_param int start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. 
  16. * @return Google_GaData 
  17. */ 
  18. public function get($ids, $start_date, $end_date, $metrics, $optParams = array()) { 
  19. $params = array('ids' => $ids, 'start-date' => $start_date, 'end-date' => $end_date, 'metrics' => $metrics); 
  20. $params = array_merge($params, $optParams); 
  21. $data = $this->__call('get', array($params)); 
  22. if ($this->useObjects()) { 
  23. return new Google_GaData($data); 
  24. } else { 
  25. return $data;