Open
Description
openedon Oct 8, 2024
Bug Description
Reported during the bug bash. Asana ticket here
The "Display visitor groups in dashboard" toggle remains visible in the Admin settings instead of the setup visitors CTA after changing the Analytics account without refreshing the page. This occurs because the audience-settings is not synced.
admin-settings-not-synced.mov
Steps to reproduce
- Enable Audience Segmentation.
- Go to the settings page and navigate to the Admin settings.
- Go the Connected services and change the Analytics account without refreshing the page.
- Go to the Admin settings again.
- Observe that the "Display visitor groups in dashboard" toggle is visible, indicating that the audience-settings is not synced as expected.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- When the connected Analytics property is changed, the "Display visitor groups in dashboard" toggle in the "Visitor groups" settings section should immediately be replaced with the "Enable groups" CTA.
Implementation Brief
- Add a new
*resetAudienceSettings()
action to the audiences settings store. This should dispatch an action whose reducer sets theaudienceSettings
state to its initialundefined
value, clear errors forgetAudienceSettings
, and invalidate thegetAudienceSettings
resolver. For an example see*resetAccounts()
:
site-kit-wp/assets/js/modules/adsense/datastore/accounts.js
Lines 51 to 64 in 3ff3c69
- Dispatch the
*resetAudienceSettings()
action in the AnalyticssubmitChanges()
function when the call tosaveSettings()
has run without erroring:
site-kit-wp/assets/js/modules/analytics-4/datastore/settings.js
Lines 158 to 164 in 3ff3c69
Test Coverage
- Add test coverage for the above changes.
- Fix any failing tests.
QA Brief
- Run through the steps to reproduce.
- Verify that the Enable groups CTA appears in the Visitor groups Settings section, rather than the Display visitor groups in dashboard toggle.
Changelog entry
- Fix an issue that caused the visitor groups visibility toggle to appear when the feature wasn't yet set up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment