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()
.onEnableGroups
withhandleEnableGroups
as the value for theonClick
prop that is passed toSpinnerButton
.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', 'tooltip_view' )
.onDismiss
callback prop toAdminMenuTooltip
. In the callback, calltrackEvent( '${viewContext}_audiences-setup-cta-dashboard', 'tooltip_dismiss' )
.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
audienceSegmentation
feature flag enabled, tracking enabled, and Analytics connected using a property which is out of the gathering data state.CTA events
view_notification
event with category{viewContext}_audiences-setup-cta-dashboard
is tracked as per the AC.confirm_notification
event with category{viewContext}_audiences-setup-cta-dashboard
is tracked as per the AC.dismiss_notification
event with category{viewContext}_audiences-setup-cta-dashboard
is tracked as per the AC.tooltip_view
event is tracked as per the AC.tooltip_dismiss
event is tracked as per the AC.Success notification events
view_notification
event with category{viewContext}_setup-success-notification-audiences
is tracked as per the AC.confirm_notification
event with category{viewContext}_setup-success-notification-audiences
is tracked as per the AC.dismiss_notification
event with category{viewContext}_setup-success-notification-audiences
is tracked as per the AC.Error modal events
OAuth error
auth_error
event is tracked as per the AC.auth_error_retry
event is tracked as per the AC.auth_error_cancel
event is tracked as per the AC.Insufficient permissions error
.*/wp-json/google-site-kit/v1/modules/analytics-4/data/sync-audiences.*
(.*)
POST
403
insufficient_permissions_error
event is tracked as per the AC.insufficient_permissions_error_request_access
event is tracked as per the AC.insufficient_permissions_error_request_cancel
event is tracked as per the AC.Generic error
.*/wp-json/google-site-kit/v1/modules/analytics-4/data/sync-audiences.*
(.*)
POST
500
setup_error
event is tracked as per the AC.setup_error_retry
event is tracked as per the AC.setup_error_request_cancel
event is tracked as per the AC.Changelog entry
The text was updated successfully, but these errors were encountered: