Commit 7acdb3b8eab747b0c50d1d1bc9d502c5adcf87f8

Authored by Alex Savenko
1 parent 978ccee2

ga output

Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
app/library/App/Controllers/GaController.php
... ... @@ -81,12 +81,12 @@ class GaController extends CrudResourceController {
81 81 $obj = $response->toSimpleObject();
82 82 $obj = $obj->reports[0]['data']['rows'];
83 83  
84   - return var_dump($obj);
  84 + //return var_dump($obj);
85 85  
86 86 $result = [];
87 87  
88   - foreach ($obj as $key => $value) {
89   - $result[$key['dimensions'][0]] = '1';
  88 + foreach ($obj as $item) {
  89 + $result[$item['dimensions'][0]] = $item['metrics'][0]['values'][0];
90 90 }
91 91  
92 92 return ($result);
... ...