thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.78k stars 2.67k forks source link

Cannot read property 'forEach' of undefined in Google Analytics #5379

Open CangeJ opened 3 years ago

CangeJ commented 3 years ago

Version information

Description

When i go on my dashboard there is no charts available

Steps To Reproduce

Steps to reproduce the behavior:

  1. Add your google client ID in settings
  2. Go back to the dashboard

Screenshots

Sans titre

I don't know if this can help you but i have :

On line 1352 : var data1 = results[0].rows.map(function (row) On line 1512 : response.rows.forEach(function (row, i) On line 1423 : var data1 = results[0].rows.map(function (row) On line 1484 : response.rows.forEach(function (row, i)

fletch3555 commented 3 years ago

To be honest, I kinda hate that this feature exists in Voyager. Seems to cause more trouble than it's worth.

Anyway, we simply make use of the Google analytics API library, so those errors are almost certainly coming from there. Most likely, either the API key is wrong, or you haven't enabled API access in your account. Or something else along those lines. Run through the GA docs to make sure you have everything correctly enabled/configured, and let us know.

CangeJ commented 3 years ago

To be honest, I kinda hate that this feature exists in Voyager. Seems to cause more trouble than it's worth.

Anyway, we simply make use of the Google analytics API library, so those errors are almost certainly coming from there. Most likely, either the API key is wrong, or you haven't enabled API access in your account. Or something else along those lines. Run through the GA docs to make sure you have everything correctly enabled/configured, and let us know.

Hi !

I'm currently working on a local dev env so maybe this is the problem... I have checked both the API key and my API access, they are ok

Update before my answer : I have now the two top charts available BUT i need to open my dev console make it higher as possible (to hide the two charts) and then i can see them... This is "special"

Edit 23/06/21 : I have now all the charts available, but as is said previously, it seems that they can't load. I need to open my dev console and then they show up. At least i have the charts without errors.