Commit e6bd80b3a5afd0f4359398b88f8b66bc12197a2f

Authored by Alex Savenko
1 parent 9f409bc3

ga response

app/library/App/Controllers/GaController.php
... ... @@ -79,7 +79,7 @@ class GaController extends CrudResourceController {
79 79 $response = $analytics->reports->batchGet($body);
80 80  
81 81 $obj = $response->toSimpleObject();
82   - $obj = $obj->reports[0]['data'];
  82 + $obj = $obj->reports[0]['data']['rows'];
83 83  
84 84 return ($obj);
85 85  
... ...
app/library/App/Resources/GaResource.php
... ... @@ -64,11 +64,11 @@ class GaResource extends ApiResource {
64 64 'view_id' => 'GA VIEW_ID',
65 65 'start' => '30daysAgo / 2015-03-01',
66 66 'end' => 'today',
67   - 'metric' => 'user,sessions',
  67 + 'metric' => 'users,sessions',
68 68 'dimension' => 'source,browser'
69 69 ]
70 70 ],
71   - 'summary' => 'http://test-30.artweb.com.ua/ga?view_id=119240817&metric=user,sessions&dimension=source,browser'
  71 + 'summary' => 'http://test-30.artweb.com.ua/ga?view_id=119240817&metric=users,sessions&dimension=source,browser'
72 72 ])
73 73 )
74 74 ;
... ...