google / google/site-kit-wp

Enhanced Measurement status gets stuck in a loading state in Settings if second admin does not have access to Analytics property

Open
#7,882 12 comments 0 reactions 3 assignees Claimed by @sigal-teller View on GitHub
Module: Analytics P1 Type: Bug
Dominant language
JavaScript
Stars
1.4k
Forks
383
Avg merge
4d 12h
Merged PRs (30d)
80

Description

## Bug Description

If another logged in admin don't have access to Analytics account or property than Enhancement Measurement status do not display. It gets stuck in a loading mode.

## Steps to reproduce

1. Set up analytics with Admin A.
2. Login with Admin who don't have access to connected analytics a/c.
3. Go to Analytics settings page.
4. See enhancement measurement status do not display and loader display continuously.

---------------

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

## Acceptance criteria

* A new `enhancedMeasurementStreamEnabled` (boolean) setting should be introduced for Analytics 4 which should hold the current status of the `streamEnabled` property from the connected web data stream's enhanced measurement settings
* The default value should be `null` to indicate an unknown state
* This setting should be set when connecting Analytics or changing the connected web data stream
* For an existing web data stream, the valuse should be set by the real value from the current enhanced measurement settings
* For a to-be created web data stream, the value should default on-demand to `true` as today
* The toggle for enabling enhanced measurement on the settings edit view should be controlled similarly to the fields for the module's entity without duplicating the existing notice present for the primary connection fields
* If the current user **does not have access** to the currently configured entity (regardless of module ownership)
* The enhanced measurement settings should not be requested as it would be guaranteed to fail
* The presentation of the control (toggle or text only) should be based on the module setting only
* The control should be disabled, and its text should also use a secondary gray token used by disabled fields
* Otherwise, the current enabled state should be requested and set by the actual enhanced measurement settings as today
* The enhanced measurement status on the settings view should be updated to display the status based on the current setting value only if present, with the following display values (as today)
* > Enable
* > Disabled
* (blank) if no value is set/known yet
* The `enhancedMeasurementStreamEnabled` setting's value should be synchronized from the connected web data stream at least once a day (if connected), when accessing the SK dashboard

## Implementation Brief

*

### Test Coverage

*

## QA Brief

*

## Changelog entry

*

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.