Commit e6bd80b3a5afd0f4359398b88f8b66bc12197a2f
1 parent
9f409bc3
ga response
Showing
2 changed files
with
3 additions
and
3 deletions
Show diff stats
app/library/App/Controllers/GaController.php
@@ -79,7 +79,7 @@ class GaController extends CrudResourceController { | @@ -79,7 +79,7 @@ class GaController extends CrudResourceController { | ||
79 | $response = $analytics->reports->batchGet($body); | 79 | $response = $analytics->reports->batchGet($body); |
80 | 80 | ||
81 | $obj = $response->toSimpleObject(); | 81 | $obj = $response->toSimpleObject(); |
82 | - $obj = $obj->reports[0]['data']; | 82 | + $obj = $obj->reports[0]['data']['rows']; |
83 | 83 | ||
84 | return ($obj); | 84 | return ($obj); |
85 | 85 |
app/library/App/Resources/GaResource.php
@@ -64,11 +64,11 @@ class GaResource extends ApiResource { | @@ -64,11 +64,11 @@ class GaResource extends ApiResource { | ||
64 | 'view_id' => 'GA VIEW_ID', | 64 | 'view_id' => 'GA VIEW_ID', |
65 | 'start' => '30daysAgo / 2015-03-01', | 65 | 'start' => '30daysAgo / 2015-03-01', |
66 | 'end' => 'today', | 66 | 'end' => 'today', |
67 | - 'metric' => 'user,sessions', | 67 | + 'metric' => 'users,sessions', |
68 | 'dimension' => 'source,browser' | 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 | ; |