Kurt\Google\Analytics\Analytics::getRealtimeData PHP Method

getRealtimeData() public method

Execute the query and fetch the results to a collection.
public getRealtimeData ( ) : array
return array
    public function getRealtimeData()
    {
        $this->validateViewId();
        $this->setMetrics('rt:activeUsers');
        $data = $this->service->data_realtime->get($this->viewId, $this->getMetricsAsString(), $this->getOptions());
        return $data->toSimpleObject()->totalsForAllResults;
    }