Commit 92c9fb64f18b04a97505630c866baff7f70d91f9
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 | 60 | } |
61 | 61 | |
62 | 62 | |
63 | -function getReport($analytics, $metric) { | |
63 | +function getReport($analytics, $metric, $alias) { | |
64 | 64 | |
65 | 65 | // Замена на свой идентификатор представления, напр. XXXX. |
66 | 66 | $VIEW_ID = "119240817"; |
... | ... | @@ -73,7 +73,7 @@ function getReport($analytics, $metric) { |
73 | 73 | // Создание объекта Metrics. |
74 | 74 | $sessions = new Google_Service_AnalyticsReporting_Metric(); |
75 | 75 | $sessions->setExpression($metric); |
76 | - $sessions->setAlias($metric); | |
76 | + $sessions->setAlias($alias); | |
77 | 77 | |
78 | 78 | |
79 | 79 | // Создание объекта ReportRequest. |
... | ... | @@ -106,10 +106,10 @@ function printResults($reports) { |
106 | 106 | for ($j = 0; $j < count( $metricHeaders ) && $j < count( $metrics ); $j++) { |
107 | 107 | $entry = $metricHeaders[$j]; |
108 | 108 | $values = $metrics[$j]; |
109 | - print("Metric type: " . $entry->getType() . "\n" ); | |
109 | + //print("Metric type: " . $entry->getType() . "\n" ); | |
110 | 110 | for ( $valueIndex = 0; $valueIndex < count( $values->getValues() ); $valueIndex++ ) { |
111 | 111 | $value = $values->getValues()[ $valueIndex ]; |
112 | - print($entry->getName() . ": " . $value . "\n"); | |
112 | + print($entry->getName() . ": " . $value . "\r\n"); | |
113 | 113 | } |
114 | 114 | } |
115 | 115 | } | ... | ... |