Feature Description
As part of the Setup Flow Refresh epic, we've decided that the Key Metrics and Audience Segmentation widgets are now integral parts of the dashboard and are set up by default when connecting Analytics.
We've also updated the Key Metrics section of the Settings screen, removing the toggle to hide the widget in the process.
However, as a result of this, existing users who have chosen to hide Key Metrics will no longer be able to toggle it on again when this feature is released.
Given that KM is now considered to be integral, we should re-show it for any users who've hidden it - and for consistency we should apply the same logic to the Audience Segmentation widget, i.e. remove its toggle from the Settings screen and re-show the widget to users who had hidden it.
We should also show a notice to affected users to inform them of the change.
This was raised in the bug bash, see this Asana task.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- Existing users who've hidden the Key Metrics widgets are re-shown the widgets on the dashboard when the
setupFlowRefresh feature flag is enabled.
- A notice is shown to affected users to inform them of the change (see Figma, and the screenshot below).
- As per the Figma design, the copy for the notice is:
- Title: Key metrics are back on your dashboard
- Description: This section is now an integral part of the dashboard. You can customize which metrics are shown to focus on the ones most relevant to you.
- Dismiss button: Got it
- CTA button: Select metrics
- Clicking the CTA button opens the Key Metrics selection panel and dismisses the notice.
- Clicking the dismiss button dismisses the notice.
- The existing "Change metrics" CTA for the widget area is updated to read "Select metrics" to align with the new design.
- This change is gated behind the
setupFlowRefresh feature flag.
Implementation Brief
Test Coverage
- Add tests for
isKeyMetricsWidgetHidden selector: verify it returns false when setupFlowRefresh is enabled regardless of stored value; verify it returns the stored value when flag is disabled.
- Add tests for
getRawKeyMetricsWidgetHidden selector: verify it always returns the actual stored value regardless of flag state.
- Add tests for
KeyMetricsBackNotice: verify UI copy and actions (dismiss + CTA) and CTA opens key metrics selection panel.
- Add tests for widget registration/placement: verify
keyMetricsBackNotice is only registered when setupFlowRefresh is enabled, is registered in AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY, and appears before the metric tiles in the rendered area.
- Add tests for widget
isActive: verify it returns true only when raw stored hidden setting is true and slug key-metrics-back-notice is not dismissed.
- Add tests for notice dismissal state: verify dismissed item (
key-metrics-back-notice) is persisted and notice doesn't reappear after dismissal.
- Add tests for notice CTA action: verify Key Metrics selection panel opens and notice dismiss state is persisted.
- Add tests for link text update: verify text is updated to "Select metrics" and still opens the selection panel when
setupFlowRefresh is enabled.
- Update any relevant stories.
QA Brief
- With the
setupFlowRefresh flag disabled, set up Site Kit with Analytics and hide the Key Metrics widget so it is hidden for your user (via the Settings -> Admin Settings -> Key Metrics Settings toggle).
- Enable the
setupFlowRefresh feature flag.
- On the dashboard, confirm the Key Metrics widget area is shown again, with the "Key metrics are back on your dashboard" notice above the metric tiles, matching the Figma design (title, description, "Got it", and "Select metrics").
- Click "Select metrics": confirm the Key Metrics selection panel opens and the notice is dismissed. Reload and confirm the notice does not reappear.
- Repeat the setup and this time click "Got it": confirm the notice is dismissed and does not reappear on reload.
- Confirm the widget area CTA link reads "Select metrics" (instead of "Change metrics") and opens the selection panel.
- With the flag disabled, confirm the behavior is unchanged: a user who hid Key Metrics still sees it hidden, the notice is not shown, and the CTA link still reads "Change metrics".
Changelog entry
- Re-show hidden Key Metrics widgets, with an explanatory notice.
Feature Description
As part of the Setup Flow Refresh epic, we've decided that the Key Metrics and Audience Segmentation widgets are now integral parts of the dashboard and are set up by default when connecting Analytics.
We've also updated the Key Metrics section of the Settings screen, removing the toggle to hide the widget in the process.
However, as a result of this, existing users who have chosen to hide Key Metrics will no longer be able to toggle it on again when this feature is released.
Given that KM is now considered to be integral, we should re-show it for any users who've hidden it - and for consistency we should apply the same logic to the Audience Segmentation widget, i.e. remove its toggle from the Settings screen and re-show the widget to users who had hidden it.
We should also show a notice to affected users to inform them of the change.
This was raised in the bug bash, see this Asana task.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
setupFlowRefreshfeature flag is enabled.setupFlowRefreshfeature flag.Implementation Brief
In
assets/js/googlesitekit/datastore/user/key-metrics.js:isKeyMetricsWidgetHiddenselector to returnfalsewhen thesetupFlowRefreshflag is enabled, regardless of the stored value, so the widget area is always visible under the flag.getRawKeyMetricsWidgetHidden) that returns the actual storedisKeyMetricsWidgetHiddensetting without the flag override. This exposes the original user preference for use by the notice component.Create new file:
assets/js/components/KeyMetrics/KeyMetricsBackNotice.js.dismissItem( 'key-metrics-back-notice' ).dismissItem( 'key-metrics-back-notice' ).setValue( KEY_METRICS_SELECTION_PANEL_OPENED_KEY, true )toCORE_UI.dismissItem( 'key-metrics-back-notice' ).Register and integrate the notice widget into the dashboard widget area:
assets/js/googlesitekit/widgets/register-defaults.js, register new widget:keyMetricsBackNotice.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARYso it renders inside the Key Metrics area (under the title/subtitle block and above metric tiles, per design).setupFlowRefreshis enabled (skip registration entirely when the flag is disabled).isActivecallback:true(getRawKeyMetricsWidgetHidden).key-metrics-back-noticeis not dismissed.Update the "Change metrics" CTA text to "Select metrics":
'Change metrics'to'Select metrics'.setupFlowRefreshflag.Test Coverage
isKeyMetricsWidgetHiddenselector: verify it returnsfalsewhensetupFlowRefreshis enabled regardless of stored value; verify it returns the stored value when flag is disabled.getRawKeyMetricsWidgetHiddenselector: verify it always returns the actual stored value regardless of flag state.KeyMetricsBackNotice: verify UI copy and actions (dismiss + CTA) and CTA opens key metrics selection panel.keyMetricsBackNoticeis only registered whensetupFlowRefreshis enabled, is registered inAREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY, and appears before the metric tiles in the rendered area.isActive: verify it returns true only when raw stored hidden setting istrueand slugkey-metrics-back-noticeis not dismissed.key-metrics-back-notice) is persisted and notice doesn't reappear after dismissal.setupFlowRefreshis enabled.QA Brief
setupFlowRefreshflag disabled, set up Site Kit with Analytics and hide the Key Metrics widget so it is hidden for your user (via the Settings -> Admin Settings -> Key Metrics Settings toggle).setupFlowRefreshfeature flag.Changelog entry