Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UA settings hidden from an Admin with no access #7028

Closed
jimmymadon opened this issue May 11, 2023 · 2 comments
Closed

UA settings hidden from an Admin with no access #7028

jimmymadon opened this issue May 11, 2023 · 2 comments
Labels
Exp: SP Module: Analytics Google Analytics module related issues P1 Medium priority Type: Bug Something isn't working

Comments

@jimmymadon
Copy link
Collaborator

jimmymadon commented May 11, 2023

Bug Description

With the ga4Reporting feature flag enabled, when an authenticated admin does not have access to the connected UA property, then they are not shown the UA settings in the Settings Edit Form. These should be visible but "disabled" as they currently are with the feature flag disabled.

Steps to reproduce

  1. Enable the ga4Reporting feature flag.
  2. Setup Site Kit and connect a UA property.
  3. Now login as another Admin whose Google Account does not have access to the connected UA property.
  4. Go to Analytics Settings and try editing the settings. The settings fields and toggle to enable/disable UA are completely hidden instead of being displayed but disabled.

Screenshots

Screen.Recording.2023-05-09.at.15.59.32.mov

Additional Context

While working on #7004, I realised there are a few places in the code which completely hide the "Universal Analytics" toggle and settings if there are no properties available. I believe we would still want to show the toggle and the settings but they should be disabled like the rest of the settings. We simply have to differentiate between when the properties aren't available due to no access or because there really aren't any properties available for the selected account. Some small tweaks will be required below:

useEffect( () => {
if ( isUAEnabled && properties.length === 0 ) {
setValues( FORM_SETUP, { enableUA: false } );
}
}, [ isUAEnabled, properties, setValues ] );

{ ga4ReportingEnabled && properties.length > 0 && (
<div className="googlesitekit-settings-module__fields-group">
<h4 className="googlesitekit-settings-module__fields-group-title">
{ __( 'Universal Analytics', 'google-site-kit' ) }
</h4>
<EnableUniversalAnalytics
hasModuleAccess={ hasAnalyticsAccess }
showErrors
>
<SettingsUseSnippetSwitch />
</EnableUniversalAnalytics>
</div>
) }

if ( properties.length === 0 ) {
return null;
}


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

Acceptance criteria

Implementation Brief

  • As the "Additional context" above mentioned, differentiating between when properties are unavailable due to no access and when they really aren't available solves this issue. This has been tried and tested in a new simple PR - Show disabled UA settings to admin with no property access. #7041 which can be reviewed and merged.
  • The failing VRT scenario needs to be fixed - "Universal Analytics" title should be moved into the EnableUniversalAnalytics component so that it is only rendered when the settings should be rendered.

Test Coverage

  • No new tests required.

QA Brief

  • Follow the steps to reproduce and verify the UA settings with disabled raw values are shown as per the AC.
  • Follow the steps to reproduce while logging in as an admin with access to the UA property to ensure they can still see, edit and save UA/GA4 settings.
  • Follow the steps to reproduce with the feature flag disabled and ensure the "old" UA/GA4 Edit Settings form works as before.
  • Test UA and GA4 setup from scratch with and without the ga4Reporting feature flag.

Changelog entry

  • Update Universal Analytics settings UX for consistency with previous interface when GA4 is the primary version and current admin lacks access.
@tofumatt
Copy link
Collaborator

IB ✅

@tofumatt tofumatt removed their assignment May 15, 2023
@jimmymadon jimmymadon self-assigned this May 15, 2023
@mxbclang mxbclang changed the title UA settings hidden from an Admin with no access [HOLD] UA settings hidden from an Admin with no access May 17, 2023
@mxbclang mxbclang changed the title [HOLD] UA settings hidden from an Admin with no access UA settings hidden from an Admin with no access May 17, 2023
@jimmymadon jimmymadon removed their assignment May 19, 2023
@hussain-t hussain-t assigned hussain-t and unassigned hussain-t May 19, 2023
@techanvil techanvil assigned techanvil and unassigned techanvil May 19, 2023
@mohitwp mohitwp self-assigned this May 25, 2023
@mohitwp
Copy link
Collaborator

mohitwp commented May 30, 2023

QA Update ✅

  • Tested on dev environment.
  • Verified an authenticated admin who does not have access to the connected Universal Analytics property is now able to view the UA settings fields when editing Analytics settings.
  • Tested when 'ga4Reporting' Feature flag is enabled and Dashboard view is UA.
  • Tested when 'ga4Reporting' Feature flag is enabled and Dashboard view is Ga4.
  • Verified analytics setup when 'ga4Reporting' feature flag is enabled.
  • Verified analytics setup when 'ga4Reporting' feature flag is not enabled.

ga4Reporting enabled - only ga4 connected

image

ga4 reporting enabled - UA connected and view is ga4

image

ga4 reporting enabled - UA connected and view is UA

image

@mohitwp mohitwp removed their assignment May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Exp: SP Module: Analytics Google Analytics module related issues P1 Medium priority Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants