Skip to content

Conversation

@ruslandoga
Copy link
Contributor

@ruslandoga ruslandoga commented Aug 29, 2024

Changes

Right now the Google's error message for 401 and 403 responses is replaced by

We were unable to authenticate your Google Analytics account. Please check that you have granted us permission to 'See and download your Google Analytics data' and try again.

This error message is not helpful in CE where extra configuration steps are involved.
This PR makes the real error message be displayed in the Plausible CE instead:

Google Analytics Admin API has not been used in project 381312896460 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/analyticsadmin.googleapis.com/overview?project=381312896460 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.

It looks ugly but provides valuable information.

Screenshot 2024-08-29 at 14 31 56 Screenshot 2024-08-29 at 14 32 22

Tests

  • Automated tests have been added

Changelog

  • Entry has been added to changelog

Documentation

  • This change does not need a documentation update

Dark mode

  • The UI has been tested both in dark and light mode

@ruslandoga ruslandoga added the self-hosting Anything self-hosted label Aug 29, 2024
@ruslandoga ruslandoga mentioned this pull request Aug 29, 2024
4 tasks

on_ce do
defp log_ce_error(action, error) do
Logger.error("Google Analytics 4: Failed when #{action}. Reason: #{inspect(error)}")
Copy link
Contributor Author

@ruslandoga ruslandoga Aug 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR also starts logging errors from Google. But only in CE.

Look like this:

Screenshot 2024-08-29 at 15 05 38

@ruslandoga ruslandoga force-pushed the better-errors-on-failed-google-imports branch from f732c7e to 4bee870 Compare August 29, 2024 08:32
@ruslandoga ruslandoga marked this pull request as ready for review August 29, 2024 08:32
@ruslandoga ruslandoga requested a review from a team August 29, 2024 08:38
@ruslandoga ruslandoga changed the title Better Google error messages on CE Better Google error messages in CE Aug 29, 2024
@zoldar zoldar force-pushed the better-errors-on-failed-google-imports branch from 4bee870 to 1468f9d Compare September 3, 2024 11:38
@zoldar zoldar merged commit 4a36148 into master Sep 3, 2024
@zoldar zoldar deleted the better-errors-on-failed-google-imports branch September 3, 2024 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

self-hosting Anything self-hosted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants