GoogleGAL_Service_Analytics_DataGa_Resource

The "ga" collection of methods.

Defined (1)

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

/core/Google/Service/Analytics.php  
  1. class GoogleGAL_Service_Analytics_DataGa_Resource extends GoogleGAL_Service_Resource 
  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 
  6. * of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. 
  7. * @param string $startDate Start date for fetching Analytics data. Requests can 
  8. * specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g.,  
  9. * today, yesterday, or 7daysAgo). The default value is 7daysAgo. 
  10. * @param string $endDate End date for fetching Analytics data. Request can 
  11. * should specify an end date formatted as YYYY-MM-DD, or as a relative date 
  12. * (e.g., today, yesterday, or 7daysAgo). The default value is yesterday. 
  13. * @param string $metrics A comma-separated list of Analytics metrics. E.g.,  
  14. * 'ga:sessions, ga:pageviews'. At least one metric must be specified. 
  15. * @param array $optParams Optional parameters. 
  16. * @opt_param int max-results The maximum number of entries to include in this 
  17. * feed. 
  18. * @opt_param string sort A comma-separated list of dimensions or metrics that 
  19. * determine the sort order for Analytics data. 
  20. * @opt_param string dimensions A comma-separated list of Analytics dimensions. 
  21. * E.g., 'ga:browser, ga:city'. 
  22. * @opt_param int start-index An index of the first entity to retrieve. Use this 
  23. * parameter as a pagination mechanism along with the max-results parameter. 
  24. * @opt_param string segment An Analytics segment to be applied to data. 
  25. * @opt_param string samplingLevel The desired sampling level. 
  26. * @opt_param string filters A comma-separated list of dimension or metric 
  27. * filters to be applied to Analytics data. 
  28. * @opt_param string output The selected format for the response. Default format 
  29. * is JSON. 
  30. * @return GoogleGAL_Service_Analytics_GaData 
  31. */ 
  32. public function get($ids, $startDate, $endDate, $metrics, $optParams = array()) 
  33. $params = array('ids' => $ids, 'start-date' => $startDate, 'end-date' => $endDate, 'metrics' => $metrics); 
  34. $params = array_merge($params, $optParams); 
  35. return $this->call('get', array($params), "GoogleGAL_Service_Analytics_GaData");