Create New `ACRSubtleNotifciation` Subtle Notification Banner Component & Include in KMW Settings Area for Users Who Have Not Yet Set Up KMW, or Users With Manual KMW Setup
Feature Description
As part of the new ACR epic, updates to the existing KMW settings area taking place. One such update is the surfacing of a new Subtle Notification style banner which will be presented to either users who have not yet set up KMW at all, or users with manual KMW setups.
The CTA of said banner will trigger the user input questionnaire, allowing KMW to be set up in a tailored manner. A screenshot of said new banner is showcased below:
This banner component, to be named ACRSubtleNotifciation, should utilize the existing SubtleNotification component given the vast similarities.
As part of this issue, Banner should be included within KMW settings area for users who have not set up KMW, OR who did manual KMW setup. It should check for VIEW_CONTEXT_SETTINGS to include the content and CTA variations.
Figma design can be found here and here
See Implementation - Subtle Banner Notification For Detected Events section of the design doc
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- New inline callout banner
ACRSubtleNotificationis created- It should match the figma design
- Banner should be shown within the Key Metrics admin settings area only if:
- KMW is not setup - the banner will replace the existing settings content
- KMW was setup manually, i.e the user chose their own metrics - the banner is shown below the
display key metrics in dashboardtoggle
- Clicking the
Maybe laterCTA should dismiss the banner- The existing content should be shown instead
- Clicking the
Get tailored metricsCTA should navigate to the user input questionnaire screen - Banner should be displayed only when
conversionReportingfeature flag is enabled - See Implementation - Subtle Banner Notification For Detected Events section of the design doc
Implementation Brief
- [ ] Update
assets/js/googlesitekit/notifications/components/layout/SubtleNotification.js, include new propiconand render included icon instead of currentCheckFillwhen present - [ ] Add
assets/js/components/KeyMetrics/ACRSubtleNotification.js- Include the above
SubtleNotificationcomponent for the markup - Add the icon from the Figma and pass it to an
iconprop of theSubtleNotification onDismisscallback should dismiss notification, usingdismissItemaction fromCORE_USERdatastore, you can use key, for exampleACR_SUBTLE_NOTIFICATION_SLUG.- Use the title, description and
additionalCTAlabel from the design, and include them as props forSubtleNotification- For
additionalCTAuseButtoncomponent, and click callback should navigate to the user input screen, you can see here how to obtain the URL https://github.com/google/site-kit-wp/blob/0525c3b6f74dd88d924de35ef7658ad67ce4e774/assets/js/components/settings/SettingsCardKeyMetrics.js#L50-L52
- For
- Check if banner was already dismissed to return early
- Include the above
- [ ] In
assets/js/components/settings/SettingsCardKeyMetrics.js- When key metrics are set up manually or not setup - https://github.com/google/site-kit-wp/blob/0525c3b6f74dd88d924de35ef7658ad67ce4e774/assets/js/components/settings/SettingsCardKeyMetrics.js#L115
- If
ACR_SUBTLE_NOTIFICATION_SLUGis not dismissed, andconversionReportingfeature flag is enabled omit displaying components in theCellhttps://github.com/google/site-kit-wp/blob/0525c3b6f74dd88d924de35ef7658ad67ce4e774/assets/js/components/settings/SettingsCardKeyMetrics.js#L121-L156 The survey trigger bellow should still be included, since banner will still offer the tailored metrics setup
- If
- When key metrics are set up manually or not setup - https://github.com/google/site-kit-wp/blob/0525c3b6f74dd88d924de35ef7658ad67ce4e774/assets/js/components/settings/SettingsCardKeyMetrics.js#L115
- [ ] Update
assets/js/components/settings/SettingsKeyMetrics.js- If key metrics were not setup - you can leverage included check https://github.com/google/site-kit-wp/blob/0525c3b6f74dd88d924de35ef7658ad67ce4e774/assets/js/components/settings/SettingsKeyMetrics.js#L77-L79 return
ACRSubtleNotificationinstead of currently returnednullwhenconversionReportingis enabled - Check if KMW was setup manually by using
getUserPickedMetricsselector, it will returnundefinedif KMW was not set manually, and conditionally renderACRSubtleNotificationafter theSwitchcomponent, ifconversionReportingis enabled. It can be in the same row, or perhaps in separate row.
- If key metrics were not setup - you can leverage included check https://github.com/google/site-kit-wp/blob/0525c3b6f74dd88d924de35ef7658ad67ce4e774/assets/js/components/settings/SettingsKeyMetrics.js#L77-L79 return
- Add
assets/sass/components/key-metrics/_googlesitekit-acr-subtle-notification.scssto include any additional styles that might be needed (like different background color, etc) - Banner should match the two scenarios, showing for users that have not yet setup KMW and when they have done the manual KMW setup
Test Coverage
- Add jest tests for
SettingsKeyMetrics, since there are no tests currently, include only the tests concerning theACRSubtleNotificationcomponent - verifying that it is showing/not showing as intended. No need to include extra test for covering the existing logic ofSettingsKeyMetricsas a whole, as that would be outside of scope for this issue - Add the basic jest test for
ACRSubtleNotificationcomponent, verifying that CTA's are working as intended
QA Brief
- Setup Site Kit with
conversionReportingfeature flag enabled - Setup Analytics module
- Go to Settings -> Admin Settings -> Key Metrics
- Verify that inline notification is showing and matches Figma design
- Verify that.
Maybe laterdismisses banner permanently andGet tailored metricsredirect to the user input questions - Notification should should when KMW are not set, or when they are setup using manual selection
- Once KMW is setup using tailored metrics, notification should not appear in settings
- Notification should not appear without feature flag
Changelog entry
@zutigrm AC looks good to me, moving to IB
IB ✔
QA Update ✅
- Tested on dev environment.
- Verified that inline notification is showing and matches Figma design
- Verified that 'Maybe later' dismisses banner permanently and 'Get tailored metrics' redirect to the user input questions.
- Verified that Notification appears only when KMW are not set, or when they are setup using manual selection
- Verified that once KMW is setup using tailored metrics, notification not appear in settings
- Verified that Notification not appear if
conversionReportingfeature flag is disabled.
'Get Tailored Metrics' CTA
https://github.com/user-attachments/assets/c042629c-b3d7-46a6-8d5e-07fa617d9a90
When user selects own metrics and 'May be later' CTA
https://github.com/user-attachments/assets/ba854cee-f599-4eb3-b9b3-9c08d4ef4400
When user set tailored metrics
https://github.com/user-attachments/assets/7471466b-f48d-44a0-978b-011976c2d9e2