Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optParams not working #39

Open
rajgaurav1 opened this issue Jun 12, 2015 · 0 comments
Open

optParams not working #39

rajgaurav1 opened this issue Jun 12, 2015 · 0 comments

Comments

@rajgaurav1
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant