function yandex_metrics_reports_retreive_data in Yandex.Metrics 8.3
Same name and namespace in other branches
- 8.2 yandex_metrics_reports/yandex_metrics_reports.module \yandex_metrics_reports_retreive_data()
- 6.2 yandex_metrics_reports/yandex_metrics_reports.module \yandex_metrics_reports_retreive_data()
- 7.3 yandex_metrics_reports/yandex_metrics_reports.module \yandex_metrics_reports_retreive_data()
- 7.2 yandex_metrics_reports/yandex_metrics_reports.module \yandex_metrics_reports_retreive_data()
Retrieves analytic information from Yandex.Metrica.
Parameters
string $service_uri: Short uri of service.
array $parameters: Associative array with parameters.
string $result_type: Result type (json, xml).
8 calls to yandex_metrics_reports_retreive_data()
- yandex_metrics_reports_gender_chart in yandex_metrics_reports/
yandex_metrics_reports.reports.inc - The function generates pie chart with demography information.
- yandex_metrics_reports_geo_chart in yandex_metrics_reports/
yandex_metrics_reports.reports.inc - The function generates pie chart with geographical information on visitors.
- yandex_metrics_reports_get_counter_for_current_site in yandex_metrics_reports/
yandex_metrics_reports.module - Gets counter ID for the current site from Yandex.Metrica.
- yandex_metrics_reports_popular_content in yandex_metrics_reports/
yandex_metrics_reports.reports.inc - The function generates the table of popular content.
- yandex_metrics_reports_search_phrases in yandex_metrics_reports/
yandex_metrics_reports.reports.inc - The function generates content of search phrases table ordered by popularity.
File
- yandex_metrics_reports/
yandex_metrics_reports.module, line 262 - The main code of Yandex.Metrics Reports module.
Code
function yandex_metrics_reports_retreive_data($service_uri, $parameters = array(), $result_type = 'json') {
$parameters['oauth_token'] = yandex_services_auth_info('token');
$query_parts = array();
foreach ($parameters as $key => $value) {
$query_parts[] = $key . '=' . $value;
}
$parameter_string = implode('&', $query_parts);
$full_service_url = "http://api-metrika.yandex.ru" . $service_uri . "." . $result_type . "?" . $parameter_string;
return drupal_http_request($full_service_url);
}