Commit 92c9fb64f18b04a97505630c866baff7f70d91f9

Authored by Alex Savenko
1 parent 74a48fa5

ga

Showing 1 changed file with 4 additions and 4 deletions   Show diff stats
backend/views/report/index.php
@@ -60,7 +60,7 @@ if (isset($_SESSION['access_token']) && $_SESSION['access_token']) { @@ -60,7 +60,7 @@ if (isset($_SESSION['access_token']) && $_SESSION['access_token']) {
60 } 60 }
61 61
62 62
63 -function getReport($analytics, $metric) { 63 +function getReport($analytics, $metric, $alias) {
64 64
65 // Замена на свой идентификатор представления, напр. XXXX. 65 // Замена на свой идентификатор представления, напр. XXXX.
66 $VIEW_ID = "119240817"; 66 $VIEW_ID = "119240817";
@@ -73,7 +73,7 @@ function getReport($analytics, $metric) { @@ -73,7 +73,7 @@ function getReport($analytics, $metric) {
73 // Создание объекта Metrics. 73 // Создание объекта Metrics.
74 $sessions = new Google_Service_AnalyticsReporting_Metric(); 74 $sessions = new Google_Service_AnalyticsReporting_Metric();
75 $sessions->setExpression($metric); 75 $sessions->setExpression($metric);
76 - $sessions->setAlias($metric); 76 + $sessions->setAlias($alias);
77 77
78 78
79 // Создание объекта ReportRequest. 79 // Создание объекта ReportRequest.
@@ -106,10 +106,10 @@ function printResults($reports) { @@ -106,10 +106,10 @@ function printResults($reports) {
106 for ($j = 0; $j < count( $metricHeaders ) && $j < count( $metrics ); $j++) { 106 for ($j = 0; $j < count( $metricHeaders ) && $j < count( $metrics ); $j++) {
107 $entry = $metricHeaders[$j]; 107 $entry = $metricHeaders[$j];
108 $values = $metrics[$j]; 108 $values = $metrics[$j];
109 - print("Metric type: " . $entry->getType() . "\n" ); 109 + //print("Metric type: " . $entry->getType() . "\n" );
110 for ( $valueIndex = 0; $valueIndex < count( $values->getValues() ); $valueIndex++ ) { 110 for ( $valueIndex = 0; $valueIndex < count( $values->getValues() ); $valueIndex++ ) {
111 $value = $values->getValues()[ $valueIndex ]; 111 $value = $values->getValues()[ $valueIndex ];
112 - print($entry->getName() . ": " . $value . "\n"); 112 + print($entry->getName() . ": " . $value . "\r\n");
113 } 113 }
114 } 114 }
115 } 115 }