function piwik_reports_get_goals in Piwik Reports 7.4
Same name and namespace in other branches
- 7.3 piwik_reports.module \piwik_reports_get_goals()
Return a list of goals active on selected site.
Parameters
string $token_auth: Piwik server token auth.
string $site: Selected site id.
Return value
array Goals returned from Piwik reports API.
1 call to piwik_reports_get_goals()
- piwik_reports_reports in ./
piwik_reports.pages.inc - Return the $form that handles piwik reports.
File
- ./
piwik_reports.module, line 539 - Defines features and functions common to Piwik Reports.
Code
function piwik_reports_get_goals($token_auth, $site) {
// TODO: shall I cache this?
$result = drupal_http_request(piwik_reports_get_url() . 'index.php?module=API&method=Goals.getGoals&idSite=' . (int) $site . '&format=JSON&token_auth=' . $token_auth);
if (empty($result->data)) {
$goals = array();
}
else {
$goals = drupal_json_decode($result->data);
}
return $goals;
}