Add GA event tracking for the Setup CTA Banner, including events which are shared with the Settings setup process #9493
Labels
Module: Analytics
Google Analytics module related issues
P0
High priority
Team M
Issues for Squad 2
Type: Enhancement
Improvement of an existing feature
Feature Description
GA events should be added to keep track of interaction with the Setup CTA Banner. Some events will be shared with the setup flow on the Settings screen.
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.
Implementation Brief
AudienceSegmentationSetupCTAWidget
component to be a module with its own folder and anindex.js
file.AudienceSegmentationSetupCTAWidget
component to a new component e.g.SetupCTAContent
.SetupCTAContent
component inforwardRef()
so aref
can be passed to it, and add theref
to its top-level rendered element.AudienceSegmentationSetupCTAWidget
component:SetupCTAContent
wrapped by thewithIntersectionObserver()
HOC, e.g.SetupCTAContentWithIntersectionObserver
. Render this in place of the existingSetupCTAContent
instance.onInView
callback prop toSetupCTAContentWithIntersectionObserver
. In the callback, calltrackEvent( '${viewContext}_audiences-setup-cta-dashboard', 'view_notification' )
.handleEnableGroups()
callback:trackEvent( '${viewContext}_audiences-setup-cta-dashboard', 'confirm_notification' )
, followed byonEnableGroups()
. Chain the two calls using.finally()
.handleDismissClick()
callback:trackEvent( '${viewContext}_audiences-setup-cta-dashboard', 'dismiss_notification' )
prior to the block wheredismissPrompt()
is called. Chain the call & code block using.finally()
.useEffect()
hook:isTooltipVisible
is true, calltrackEvent( '${viewContext}_audiences-setup-cta-dashboard', 'view_tooltip' )
.onDismiss
callback prop toAdminMenuTooltip
. In the callback, calltrackEvent( '${viewContext}_audiences-setup-cta-dashboard', 'dismiss_tooltip' )
.trackEventCategory
prop (see Add GA event tracking for the "Top content" metric area of an Audience Tile #9495) toAudienceErrorModal
with the value${viewContext}_audiences-setup
.SettingsCardVisitorGroups/SetupCTA
component:trackEventCategory
prop toAudienceErrorModal
with the value${viewContext}_audiences-setup
.Note that the events with category
{viewContext}_setup-success-notification-audiences
were implemented via #9281, and the logic for the events with category{viewContext}_audiences-setup
will have been implemented via #9495, with only the category itself needing to be passed intoAudienceErrorModal
in this issue. We should still test all of the listed events in QA.Test Coverage
auth_error
,insufficient_permissions_error
andsetup_error
GA events can be excluded from the coverage as discussed here under Relevant technical choices: Add GA event tracking for the "Top content" metric area of an Audience Tile #9542 (comment)QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: