Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Site Goals intro banner incorrectly shown to users without GA access #12786

Description

@kelvinballoo

Bug Description

Site goals only appears under view-only user when granted with Analytics access.

There is a bug whereby I only granted a user access to SC and not GA and the intro banner for Site Goals would appear.
Explanation in the attached video:

12577.-.View.only.has.modal.when.should.not.not.ok.mov

Steps to reproduce

  • Install and activate the Site Kit plugin on a WordPress site.
  • Complete the Site Kit setup as an admin and connect Google Analytics and Search Console.
  • Go to the WordPress user management and create or select a view-only user.
  • Grant the view-only user access to Search Console only — do NOT grant Google Analytics access.
  • Log in as the view-only user.
  • Navigate to the Site Kit dashboard.
  • Observe that the Site Goals intro banner is displayed, even though the user does not have Google Analytics access.

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • For a view only user, the Site Goals widget, the introduction banner, and Site Goals selection panel should only be rendered when the user has dashboard sharing access to the Analytics module.
    • This is in addition to the already existing conditions to render the widget (i.e. availability of detected events, etc)

Implementation Brief

  • Update assets/js/components/DashboardMainApp.js to gate the site goals rendering block with the existing hasAnalyticsAccess check
    • Currently the site goals block (SiteGoalsSelectionPanel + SiteGoalsIntroModalBanner) is gated only by siteGoalsEnabled. Wrap it additionally with hasAnalyticsAccess - the same guard already used for the audience segmentation panel via hasAccessToShareableModule( MODULE_SLUG_ANALYTICS_4 )
      • This guards both the intro modal banner AND the selection panel in one place

Test Coverage

  • No updates needed

QA Brief

  • Install and activate Site Kit plugin.
  • Complete the Site Kit setup as an admin and connect Google Analytics and Search Console.
  • Set up Dashboard sharing and grant view-only access to Search Console only — do NOT grant Google Analytics access (for any user group, but the user created below should be a part of that role).
  • Create a user with the above role, then sign in as view-only user to Site Kit.
  • Log in as the view-only user.
  • Navigate to the Site Kit dashboard.
  • The Site Goals intro banner should NOT be displayed.

Changelog entry

  • Fix Site Goals intro banner issue when the banner shows up to users with no GA access.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0High priorityTeam SIssues for Squad 1Type: BugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions