-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GA event tracking for the "Top content" metric area of an Audience Tile #9495
Comments
Thank you for drafting the IB, @techanvil !
Just to confirm, did you mean Also, do you think it might be worth bumping up the estimate for this one by a notch considering the slightly wider surface area? Thanks! |
I certainly did, thanks for another catch! I've fixed the typo, and bumped the estimate too, that SGTM. Back over to you, cheers! |
Thank you Tom! IB ✅ |
QA Update ⚠Hi @techanvil , 9495.update.button.doesn.t.appear.mov |
Hi @kelvinballoo, it looks like you have mock report data enabled in the Tester plugin. This scenario can't be tested using mock data as it relies on the insufficient permissions error that is returned by a real report. Please try again with mock report data disabled. |
QA Update ✅The GA events were logged successfully for all the events.
|
Feature Description
GA events should be added to keep track of interaction with the "Top content" metric area of an Audience Tile.
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
AudienceTilePagesMetricContent
component to a new component e.g.CreateCustomDimensionCTA
.CreateCustomDimensionCTA
component inforwardRef()
so aref
can be passed to it, and add theref
to its top-level rendered element.AudienceTilePagesMetricContent
component:CreateCustomDimensionCTA
wrapped by thewithIntersectionObserver()
HOC, e.g.CreateCustomDimensionCTAWithIntersectionObserver
. Render this in place of the existingCreateCustomDimensionCTA
instance.onInView
callback prop toCreateCustomDimensionCTAWithIntersectionObserver
. In the callback, calltrackEvent( '${viewContext}_audiences-top-content-cta', 'view_cta' )
.handleCreateCustomDimension()
callback:trackEvent( '${viewContext}_audiences-top-content-cta', 'create_custom_dimension' )
, followed byonCreateCustomDimension()
. Chain the two calls using.finally()
.handleCreateCustomDimension
toCreateCustomDimensionCTAWithIntersectionObserver
instead ofonCreateCustomDimension
.ModalDialog
component:onOpen
prop of typePropTypes.func
, and pass the prop to the renderedDialog
component.handleConfirm
prop through to theButton
instance that is rendered whenbuttonLink
is provided.AudienceErrorModal
component:trackEventCategory
prop of typePropTypes.string
.onOpen
callback prop toModalDialog
:action
for the GA event:auth_error
for an OAuth error,insufficient_permissions_error
for an insufficient permissions error, orsetup_error
for any other error.trackEvent( trackEventCategory, action )
.handleConfirm
callback:action
for the GA event:auth_error_retry
for an OAuth error,insufficient_permissions_error_request_access
for an insufficient permissions error, orsetup_error_retry
for any other error.trackEvent( trackEventCategory, action )
, followed byonRetry()
unless the error is an insufficient permissions error. Chain the two calls using.finally()
.onRetry
withhandleConfirm
as the value for thehandleConfirm
prop that is passed toModalDialog
.handleDialog
callback:action
for the GA event:auth_error_cancel
for an OAuth error,insufficient_permissions_error_cancel
for an insufficient permissions error, orsetup_error_cancel
for any other error.trackEvent( trackEventCategory, action )
, followed byonCancel()
. Chain the two calls using.finally()
.onCancel
withhandleDialog
as the value for thehandleDialog
prop that is passed toModalDialog
.AudienceTilePagesMetric
component:trackEventCategory
prop toAudienceErrorModal
with the value${viewContext}_audiences-top-content-cta
.Test Coverage
QA Brief
CTA events
audienceSegmentation
feature flag enabled, tracking enabled, and Analytics connected using a property which is out of the gathering data state.googlesitekit_post_type
custom dimension in Analytics.view_cta
event is tracked as per the AC.create_custom_dimension
event is tracked as per the AC.Error Modal events
OAuth error
{db_prefix}_googlesitekit_additional_auth_scopes
entry from the{db_prefix}_usermeta
table and refresh the page to ensure the edit scope is needed.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/create-custom-dimension.*
(.*)
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/create-custom-dimension.*
(.*)
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: