Feature Description
Add GA event tracking for the Analytics account creation error notice and the new "Answer question" button in the Key Metrics settings panel.
The events to track are defined in the events sheet.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
The following GA events are tracked when their conditions are met:
| Event Name |
Category |
Label |
Trigger |
Condition |
analytics_account_creation_error |
{viewContext}_setup |
error code returned from the service |
element visibility |
user views the "Analytics account creation failed" error notice on the Analytics setup screen - ONLY initial setup (NOT module setup) |
analytics_account_creation_error |
{viewContext} |
error code returned from the service |
element visibility |
user views the "Analytics account creation failed" error notice on the Analytics setup screen - ONLY module setup (NOT initial setup) |
select_answer |
{viewContext}_kmw |
identifier of the question to answer |
click |
user clicks on "Answer question" for a question in the KM settings panel |
Implementation Brief
Test Coverage
- Add test coverage for the error notice in
assets/js/modules/analytics-4/components/common/AccountCreate/AnalyticsAccountCreationErrorNotice.test.tsx
- Add test coverage for the "Answer question" button event in
assets/js/components/user-input/UserInputPreviewGroup.test.js
QA Brief
- Use the Analytics Debugger Chrome extension.
- Turn on the
setupFlowRefresh feature flag.
During initial setup
- Start the setup and go upto
Set up Analytics step, add accountCreationErrorCode=testError query parameter in URL and refresh the page.
- Notice that event
analytics_account_creation_error is triggered with event category set to moduleSetup_setup and also the event_label as error code testError is passed.
Post setup completion
- Complete the setup.
- Start the analytics setup and come back till
Connect Service - Analytics screen after initial auth.
- Add
accountCreationErrorCode=testError query parameter in URL and refresh the page.
- Notice that event
analytics_account_creation_error is triggered with event category set to moduleSetup and also the event_label as error code testError is passed.
Key Metrics Settings
- Once setup is completed with Analytics connected, go to
Site Kit > Settings > Admin Settings > Personalized metrics
- Click
Answer question CTA
- Notice that event
select_answer is triggered with event category set to settings_kmw and also the event_label as either postFrequency or goals.
Changelog entry
- Add opt-in user tracking for the Analytics account creation error notice and the new "Answer question" button in the Key Metrics settings panel.
Feature Description
Add GA event tracking for the Analytics account creation error notice and the new "Answer question" button in the Key Metrics settings panel.
The events to track are defined in the events sheet.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
The following GA events are tracked when their conditions are met:
analytics_account_creation_error{viewContext}_setupanalytics_account_creation_error{viewContext}select_answer{viewContext}_kmwImplementation Brief
assets/js/modules/analytics-4/components/common/AccountCreate/AnalyticsAccountCreationErrorNotice.tsxshowProgressquery arg is presentuseViewContexttrackEventinside auseEffectwith:category:category:{viewContext}_setupif we're in initial setup, otherwise justviewContextaction: "analytics_account_creation_error"label:errorCode(coming from the component's props)assets/js/components/user-input/UserInputPreviewGroup/index.tsxuseViewContextonClickprop ofAnswerQuestionButtonto include a call totrackEventwith:category:category:{viewContext}_kmwaction: "select_answer"label:slug(coming from the component's props)Test Coverage
assets/js/modules/analytics-4/components/common/AccountCreate/AnalyticsAccountCreationErrorNotice.test.tsxassets/js/components/user-input/UserInputPreviewGroup.test.jsQA Brief
setupFlowRefreshfeature flag.During initial setup
Set up Analyticsstep, addaccountCreationErrorCode=testErrorquery parameter in URL and refresh the page.analytics_account_creation_erroris triggered with event category set tomoduleSetup_setupand also theevent_labelas error codetestErroris passed.Post setup completion
Connect Service - Analyticsscreen after initial auth.accountCreationErrorCode=testErrorquery parameter in URL and refresh the page.analytics_account_creation_erroris triggered with event category set tomoduleSetupand also theevent_labelas error codetestErroris passed.Key Metrics Settings
Site Kit > Settings > Admin Settings > Personalized metricsAnswer questionCTAselect_answeris triggered with event category set tosettings_kmwand also theevent_labelas eitherpostFrequencyorgoals.Changelog entry