Commit 51e8991c8a3aa21efb192192b646e8b3ebc535d3

Authored by Alex Savenko
1 parent 7fe1d3b2

create response

Showing 1 changed file with 1 additions and 2 deletions   Show diff stats
app/library/App/Controllers/GaController.php
@@ -29,8 +29,6 @@ class GaController extends CrudResourceController { @@ -29,8 +29,6 @@ class GaController extends CrudResourceController {
29 $client = new Google_Client(); 29 $client = new Google_Client();
30 $client->useApplicationDefaultCredentials(); 30 $client->useApplicationDefaultCredentials();
31 $client->setScopes(['https://www.googleapis.com/auth/analytics.readonly']); 31 $client->setScopes(['https://www.googleapis.com/auth/analytics.readonly']);
32 - $api_key = 'AIzaSyBNYr7n7bcHbO-sJ9xuWwS9xQ2OY5aFAiE';  
33 - $client->setDeveloperKey($api_key);  
34 $analytics = new Google_Service_AnalyticsReporting($client); 32 $analytics = new Google_Service_AnalyticsReporting($client);
35 33
36 $param[] = ['metric' => 'ga:sessions', 'alias' => 'Сессии']; 34 $param[] = ['metric' => 'ga:sessions', 'alias' => 'Сессии'];
@@ -62,6 +60,7 @@ class GaController extends CrudResourceController { @@ -62,6 +60,7 @@ class GaController extends CrudResourceController {
62 $response = $analytics->reports->batchGet( $body ); 60 $response = $analytics->reports->batchGet( $body );
63 } 61 }
64 62
  63 + return $response->toSimpleObject();
65 return $this->printResults($response); 64 return $this->printResults($response);
66 65
67 } 66 }