diff --git a/backend/views/report/index.php b/backend/views/report/index.php index 3dc5fb6..ae646f4 100644 --- a/backend/views/report/index.php +++ b/backend/views/report/index.php @@ -60,7 +60,7 @@ if (isset($_SESSION['access_token']) && $_SESSION['access_token']) { } -function getReport($analytics, $metric) { +function getReport($analytics, $metric, $alias) { // Замена на свой идентификатор представления, напр. XXXX. $VIEW_ID = "119240817"; @@ -73,7 +73,7 @@ function getReport($analytics, $metric) { // Создание объекта Metrics. $sessions = new Google_Service_AnalyticsReporting_Metric(); $sessions->setExpression($metric); - $sessions->setAlias($metric); + $sessions->setAlias($alias); // Создание объекта ReportRequest. @@ -106,10 +106,10 @@ function printResults($reports) { for ($j = 0; $j < count( $metricHeaders ) && $j < count( $metrics ); $j++) { $entry = $metricHeaders[$j]; $values = $metrics[$j]; - print("Metric type: " . $entry->getType() . "\n" ); + //print("Metric type: " . $entry->getType() . "\n" ); for ( $valueIndex = 0; $valueIndex < count( $values->getValues() ); $valueIndex++ ) { $value = $values->getValues()[ $valueIndex ]; - print($entry->getName() . ": " . $value . "\n"); + print($entry->getName() . ": " . $value . "\r\n"); } } } -- libgit2 0.21.4