site-kit-wp icon indicating copy to clipboard operation
site-kit-wp copied to clipboard

Add GA event tracking for the Intro Popup/Banner

Open techanvil opened this issue 1 year ago • 1 comments

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 AudienceSegmentationIntroductoryOverlayNotification component:
    • Add an onShow callback prop to the rendered OverlayNotification. In the callback, call trackEvent( '${viewContext}_audiences-secondary-user-intro', 'view_notification' ).
    • Lift the contents of dismissNotification() to a new dismissNotice() function.
    • In scrollToWidgetAndDismissNotification(), replace the call to dismissNotification() with a call to trackEvent( '${viewContext}_audiences-secondary-user-intro', 'confirm_notification' ) followed by dismissNotice(). Chain the two calls using .finally().
    • In dismissNotification(), call trackEvent( '${viewContext}_audiences-secondary-user-intro', 'dismiss_notification' ) followed by dismissNotice(). Again, chain the two calls using .finally().
  • See the PublicationApprovedOverlayNotification component for an example to follow.

Test Coverage

  • Add coverage for the above changes to the tests for AudienceSegmentationIntroductoryOverlayNotification.

QA Brief

Changelog entry

techanvil avatar Oct 11 '24 15:10 techanvil

IB ✅

nfmohit avatar Oct 18 '24 18:10 nfmohit

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_notification and dismiss_notification GA 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

Image

Image

2. Confirm Notification ( When user clicks on 'Show me' on the popup )

Image

Image

3. Dismiss Notification ( When user clicks on 'Got it' on the popup )

Image

Image

Screencast

https://github.com/user-attachments/assets/9ba85bfa-917f-4f68-a60b-6b470f640879

Secondary Admin Dashboard

1. View Notification

Image

Image

2. Confirm Notification ( When user clicks on 'Show me' on the popup )

Image

Image

3. Dismiss Notification ( When user clicks on 'Got it' on the popup )

Image

Image

mohitwp avatar Nov 06 '24 14:11 mohitwp