Google_DataRealtimeServiceResource

The "realtime" 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_DataRealtimeServiceResource extends Google_ServiceResource { 
  2.  
  3. /** 
  4. * Returns real time data for a view (profile). (realtime.get) 
  5. * @param string $ids Unique table ID for retrieving real time data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. 
  6. * @param string $metrics A comma-separated list of real time metrics. E.g., 'ga:activeVisitors'. At least one metric must be specified. 
  7. * @param array $optParams Optional parameters. 
  8. * @opt_param string dimensions A comma-separated list of real time dimensions. E.g., 'ga:medium, ga:city'. 
  9. * @opt_param string filters A comma-separated list of dimension or metric filters to be applied to real time data. 
  10. * @opt_param int max-results The maximum number of entries to include in this feed. 
  11. * @opt_param string sort A comma-separated list of dimensions or metrics that determine the sort order for real time data. 
  12. * @return Google_RealtimeData 
  13. */ 
  14. public function get($ids, $metrics, $optParams = array()) { 
  15. $params = array('ids' => $ids, 'metrics' => $metrics); 
  16. $params = array_merge($params, $optParams); 
  17. $data = $this->__call('get', array($params)); 
  18. if ($this->useObjects()) { 
  19. return new Google_RealtimeData($data); 
  20. } else { 
  21. return $data;