Commit b12e40c2fb3f56538fc13a28631e105d1c978b41
1 parent
120f7a64
ga response
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
app/library/App/Controllers/GaController.php
@@ -33,7 +33,7 @@ class GaController extends CrudResourceController { | @@ -33,7 +33,7 @@ class GaController extends CrudResourceController { | ||
33 | $client->setScopes(['https://www.googleapis.com/auth/analytics.readonly']); | 33 | $client->setScopes(['https://www.googleapis.com/auth/analytics.readonly']); |
34 | $analytics = new Google_Service_AnalyticsReporting($client); | 34 | $analytics = new Google_Service_AnalyticsReporting($client); |
35 | 35 | ||
36 | - $param[] = ['metric' => 'ga:'.$getMetric]; | 36 | + $param[] = ['metric' => 'ga:'.$getMetric, 'alias' => $getMetric]; |
37 | 37 | ||
38 | $response = []; | 38 | $response = []; |
39 | 39 | ||
@@ -47,6 +47,7 @@ class GaController extends CrudResourceController { | @@ -47,6 +47,7 @@ class GaController extends CrudResourceController { | ||
47 | // Создание объекта Metrics. | 47 | // Создание объекта Metrics. |
48 | $metrics = new Google_Service_AnalyticsReporting_Metric(); | 48 | $metrics = new Google_Service_AnalyticsReporting_Metric(); |
49 | $metrics->setExpression($item['metric']); | 49 | $metrics->setExpression($item['metric']); |
50 | + $metrics->setExpression('ga:pageviewsPerSession'); | ||
50 | //$sessions->setAlias($item['alias']); | 51 | //$sessions->setAlias($item['alias']); |
51 | 52 | ||
52 | 53 |