analytics-l4 icon indicating copy to clipboard operation
analytics-l4 copied to clipboard

optParams not working

Open rajgaurav1 opened this issue 10 years ago • 0 comments

i'm using parameters like sort and max-results, but aren't working, my code is below

$site_id = Analytics::getSiteIdByUrl('http://www.wallaroohats.com'); // return something like 'ga:11111111'

    $arr = array("max-results" => 10);

    $stats = Analytics::query($site_id, '2015-06-01', '2015-06-08', 'ga:sessions', 'ga:source', $arr);

The below is the code in Analytics.php

public function get($ids, $startDate, $endDate, $metrics, $dimensions, $optParams = array()) { $params = array('ids' => $ids, 'start-date' => $startDate, 'end-date' => $endDate, 'metrics' => $metrics, 'dimensions' => $dimensions); $params = array_merge($params, $optParams); return $this->call('get', array($params), "Google_Service_Analytics_GaData"); }

Please help me out

rajgaurav1 avatar Jun 12 '15 06:06 rajgaurav1