-
Notifications
You must be signed in to change notification settings - Fork 330
Description
Describe the bug
After successfully connecting an Analytics account (using the same Google account OAuth which to verify the setup) an "Issue accessing data" notice appears.
While Analytics reporting in the dashboard is fine there the notice remains and trying to re authenticate your account via the button in the notice doesn't solve the issue, the notice reappears.
To Reproduce
Steps to reproduce the behavior:
- Active Site Kit
- Settings > Connect more services > Analytics
- Complete setup procedure
Expected behavior
Notice should not appear
System information:
- PHP Version: 7.2
- OS: Mac
- Browser : Chrome
- Plugin Version: 1.0.0-beta.1
- Host OS: Linux
- Additional Plugins: TagDiv Composer
Additional context
Another report of same issue from this issue: #1
Site Kit data module check:
https://github.com/google/site-kit-wp/blob/develop/assets/js/components/data.js#L275-L280
insufficientPermission is because of oauth scopes, which happen in most of the cases.
In this case the insufficientPermission is because user doesn't have access to the Analytics Goals.
Preliminary work here:
https://github.com/google/site-kit-wp/compare/fix/insufficient-permission?expand=1
Do not alter or remove anything below. The following sections will be managed by moderators only.
Changelog entry
Acceptance criteria
- For every user who has successfully set up GA and metrics appear in the main plugin dashboard, no error notices should appear.
- For users that do not have access to Goals, the goals datablock will show a CTA to request access.
Implementation Brief
-
Remove the
insufficientPermissionerror check from the data module. insufficient scope check already in place elsewhere. -
Handle
insufficientPermissionerror specifically inAnalyticsDashboardWidgetTopLevelcomponent
- when the goals data point returnsgetAnalyticsErrorMessageFromData insufficientPermissionshow a CTA that the user cannot access Goals.
