site-kit-wp
site-kit-wp copied to clipboard
Add GA event tracking for the Intro Popup/Banner
Feature Description
GA events should be added to keep track of interaction with the Intro Popup/Banner.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
The following GA events should be tracked for the given actions. See the GA events sheet.
| Event Name | Category | Trigger | Condition |
|---|---|---|---|
| view_notification | {viewContext}_audiences-secondary-user-intro | Element visibility | User views the Intro Popup/Banner shown to a user after the feature has been setup by another user |
| confirm_notification | {viewContext}_audiences-secondary-user-intro | Click | User clicks "Show me" on the popup/banner |
| dismiss_notification | {viewContext}_audiences-secondary-user-intro | Click | User clicks "Got it" on the popup/banner |
Implementation Brief
- [ ] In the
AudienceSegmentationIntroductoryOverlayNotificationcomponent:- Add an
onShowcallback prop to the renderedOverlayNotification. In the callback, calltrackEvent( '${viewContext}_audiences-secondary-user-intro', 'view_notification' ). - Lift the contents of
dismissNotification()to a newdismissNotice()function. - In
scrollToWidgetAndDismissNotification(), replace the call todismissNotification()with a call totrackEvent( '${viewContext}_audiences-secondary-user-intro', 'confirm_notification' )followed bydismissNotice(). Chain the two calls using.finally(). - In
dismissNotification(), calltrackEvent( '${viewContext}_audiences-secondary-user-intro', 'dismiss_notification' )followed bydismissNotice(). Again, chain the two calls using.finally().
- Add an
- See the
PublicationApprovedOverlayNotificationcomponent for an example to follow.
Test Coverage
- Add coverage for the above changes to the tests for
AudienceSegmentationIntroductoryOverlayNotification.
QA Brief
Changelog entry
IB ✅
QA Update ✅
- Tested on dev environment.
- Tested GA events on view only dashboard.
- Tested GA events for secondary admin main dashboard.
- Verified
view_notification,confirm_notificationanddismiss_notificationGA events triggered successfully for seconday user on view only dashboard and main dashboard. - Verified that the GA events are tracked correctly when interacting with the Intro Popup/Banner as per the AC.
View Only Dashboard
1. View Notification
2. Confirm Notification ( When user clicks on 'Show me' on the popup )
3. Dismiss Notification ( When user clicks on 'Got it' on the popup )
Screencast
https://github.com/user-attachments/assets/9ba85bfa-917f-4f68-a60b-6b470f640879
Secondary Admin Dashboard
1. View Notification
2. Confirm Notification ( When user clicks on 'Show me' on the popup )
3. Dismiss Notification ( When user clicks on 'Got it' on the popup )