thedevdojo / voyager

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

Google Analytics on Laravel Voyager Admin #2216

Open shrihub opened 7 years ago

shrihub commented 7 years ago

Description:

After adding google analytics client ID in Voyager, sometimes you may not get the analytics report right away in the voyager dashboard page; Instead it will show the below text.

You are logged in as: @.com

Steps To Reproduce:

  1. Create a google analytics client ID under https://console.developers.google.com
  2. Return to Voyager admin -> Settings -> Add the client ID under admin section and save.
  3. Go to Voyager dashboard where you may only see the text "You are logged in as: xxxx@email.com"

Solution: Enable google analytics API after creating your client ID.

  1. Go to https://console.developers.google.com
  2. Select Library
  3. Search for the keyword 'analytics'
  4. Click on 'Analytics API'
  5. Click on Enable

screen shot 2017-11-11 at 11 26 21 am screen shot 2017-11-11 at 11 26 36 am screen shot 2017-11-11 at 11 28 32 am

MicrowaveDev commented 6 years ago

Same problem

mattrabe commented 6 years ago

Thank you for posting this

chrisdicarlo commented 6 years ago

Still seems to be an issue?

mattrabe commented 6 years ago

I was having this problem previously, but not longer am thanks to this post. After enabling the API in the Google Library I also had to make sure to log in to google using the correct account (I have multiple google accounts and only one of them had access to the analytics data I was trying to access), but after that it works well for me.

harunthuo commented 6 years ago

this worked for me. thankyou

ghost commented 6 years ago

same problem

fletch3555 commented 6 years ago

Guys, please stop commenting "Same problem". This issue isn't about a problem (at least not one within Voyager's control). It's about adding documentation to assist devs with getting past this step.

ghost commented 6 years ago

I think the problem happen because http must be https in xampp

On 18 June 2018 at 16:41, Eric Fletcher notifications@github.com wrote:

Guys, please stop commenting "Same problem". This issue isn't about a problem (at least not one within Voyager's control). It's about adding documentation to assist devs with getting past this step.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/the-control-group/voyager/issues/2216#issuecomment-398077701, or mute the thread https://github.com/notifications/unsubscribe-auth/AeQu8wn5-pvYGG-sBIauuohGQ4lYf-1Lks5t97wEgaJpZM4Qa4MO .

mukhlisa96 commented 4 years ago

I guess you should install an analytics tool on your page. go to https://analytics.google.com/analytics and register your website. then copy the code like

``` ```**

and past it inside head tag as the first element.

thelesson commented 4 years ago

If someone encountered a problem by following these steps. Delete the OAuth ID and create again after enabling the Analytics API. I enabled the api after creating the OAuth ID and it didn't work, only after deleting and enabling it again that I managed to make it work

alkhachatryan commented 3 years ago

Same problem, 2021.

@fletch3555 you say it's not a Voyager problem, but I did as Voyager docs said.

arsengoian commented 2 years ago

@alkhachatryan see https://github.com/the-control-group/voyager/issues/5495

It seems to be a new issue. Did you find a solution?

umutcanli commented 2 years ago

same problem from 2022

EslamMuhammedSaeed commented 2 years ago

Same problem

arsengoian commented 2 years ago

Guys, the solution is to build a server-side integration with GA 4 Data API.

see https://packagist.org/packages/google/analytics-data https://developers.google.com/analytics/devguides/reporting/data/v1

If only anyone coult imlpement this and make a PR. We did this, but with a third-party proprietary charting library on front-end, so we can't unfortunately offer our solution.

This could literally be done in a day 🤔

I would be happy to assist to anyone working on such a PR

Andre-ADPC commented 2 years ago

Hi, off on a tangent here regarding GA: Google is facing more and more resistance from the world outside the US in regards to stiff legal sanctions and fines imposed on them at governmental levels in the EU recently. Yes it is free to use for devs, but at what hidden cost? Ref A: European rulings on the use of Google Analytics and how it may affect your business Ref B: EU declares Google Analytics illegal: Here’s why

What about considering giving devs an option between something like GA and Fathom for example. Yes, there are others, but Fathom seems quite adamant that they out-perform GA substantially, and are rooting for the business customers' and in return their end user's privacy. Google is in it for one purpose, "Get their data and leverage it into cash", period.

GitHub is one of their main customers too. Ironic? Probably not.

The choice is thus offered as an option at solution presentation time and the developer can then implement the option the customer decides on.

Here is a reference article, one of many, that discusses why GA is losing and is going to lose more track: Fathom Analytics vs Google Analytics

The most interesting thing is that most of you can add it to Voyager yourselves. Fathom states that it is a mere "one-liner" in your head section.

Their words: "To start using Fathom Analytics, you simply have to add a single line of code to the head section of your website (where “ABCDEFG” is your actual Site ID):"

<script src="https://cdn.usefathom.com/script.js" data-site="ABCDEFG" defer></script>

"However, we recommend using a custom domain, as those bypass ad-blockers and show you 100% of your traffic."

There are several packages available on Packagist that should make your lives easier when implementing it in more customised approaches too.

This is just an observation from a guy that has learned to Never Say Never.