Skip to content

"Issue accessing data" notice appear when Analytics is added  #12

@jamesozzie

Description

@jamesozzie

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:

  1. Active Site Kit
  2. Settings > Connect more services > Analytics
  3. Complete setup procedure

Expected behavior
Notice should not appear

Screen Shot 2019-06-20 at 3 49 23 PM

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 insufficientPermission error check from the data module. insufficient scope check already in place elsewhere.

  • Handle insufficientPermission error specifically in AnalyticsDashboardWidgetTopLevel component

    - when the goals data point returns insufficientPermission show a CTA that the user cannot access Goals.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions