Kurt\Google\Analytics\Analytics::execute PHP Method

execute() public method

Execute the query by merging arrays to current ones.
public execute ( array $parameters = [], $parseResult = true )
$parameters array
    public function execute($parameters = [], $parseResult = true)
    {
        $this->validateViewId();
        $this->mergeParams($parameters);
        /*
         * A query can't run without any metrics.
         */
        if (!$this->metricsAreSet()) {
            throw new UndefinedMetricsException();
        }
        $result = $this->service->data_ga->get($this->viewId, $this->period->getStartDate()->format('Y-m-d'), $this->period->getEndDate()->format('Y-m-d'), $this->getMetricsAsString(), $this->getOptions());
        if ($parseResult) {
            return $this->parseResult($result);
        }
        return $result;
    }