-
Notifications
You must be signed in to change notification settings - Fork 330
Closed
Labels
P0High priorityHigh priorityTeam MIssues for Squad 2Issues for Squad 2Type: EnhancementImprovement of an existing featureImprovement of an existing feature
Description
Feature Description
GA events should be added to keep track of interaction with the Key Metrics setup 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.
| Event Name | Category | Label | Trigger | Condition |
|---|---|---|---|---|
setup_flow_v3_view_key_metrics_step |
{viewContext}_setup |
element visibility | Key Metrics setup screen appears (NOT module setup) | |
setup_flow_v3_select_key_metrics_answer |
{viewContext}_setup |
one of: sell_products, provide_services, monetize_content, publish_blog, publish_news, share_portfolio |
click | user picks reponses to the site purpose question (NOT module setup) |
setup_flow_v3_complete_key_metrics_step |
{viewContext}_setup |
click | user clicks on "Complete setup" (NOT module setup) | |
view_key_metrics_step |
{viewContext} |
element visibility | Key Metrics setup screen appears - ONLY module setup (NOT initial setup) | |
select_key_metrics_answer |
{viewContext} |
one of: sell_products, provide_services, monetize_content, publish_blog, publish_news, share_portfolio |
click | user picks reponses to the site purpose question (NOT initial setup) |
complete_key_metrics_step |
{viewContext} |
click | user clicks on "Complete setup" (NOT initial setup) | |
| ______________________________________________ | _______________________ | ______________________________________ | ______________ | _____________________________________________ |
Implementation Brief
- Update
assets/js/components/user-input/UserInputSelectOptions.js- Add an optional
onSelectprop and call it inside theonClickcallback
- Add an optional
- In
assets/js/components/key-metrics-setup/KeyMetricsSetupApp.js- Grab the current
viewContextusing theuseViewContexthook - Track if the Key Metrics Setup screen is viewed using the
useMounthook- If
isInitialSetupFlowistrue, calltrackEventusing the following arguments- category:
{viewContext}_setup - action:
"setup_flow_v3_view_key_metrics_step"
- category:
- Otherwise, call it with the following arguments:
- category:
viewContext - action:
"view_key_metrics_step"
- category:
- If
- Inside the
onSaveClickcallback, after theisBusy || isSyncingguard, calltrackEventwith the following arguments:- If
isInitialSetupFlowistrue:- category:
{viewContext}_setup - action:
"setup_flow_v3_complete_key_metrics_step"
- category:
- Otherwise:
- category:
viewContext - action:
"complete_key_metrics_step"
- category:
- If
- Create a callback called
onSelectthat takes an array of checked values and pass it to theUserInputSelectOptionscomponent in theonSelectprop. Inside, calltrackEventwith the following arguments- If
isInitialSetupFlowistrue:- category:
{viewContext}_setup - action:
"setup_flow_v3_select_key_metrics_answer" - label:
checkedValues[0]
- category:
- Otherwise:
- category:
viewContext - action:
"select_key_metrics_answer" - label:
checkedValues[0]
- category:
- If
- The first two arguments of
trackEvent(category and action) for each event can be put in a variable if that turns out to be cleaner than 3 scatteredif elsestatements
- Grab the current
Test Coverage
- Add test coverage to ensure all 6 events are correctly tracked
QA Brief
- Turn on the
setupFlowRefreshfeature in the tester plugin. - Install the Google Analytics Debugger Chrome extension and Open the browser developer tool's Console tab.
With Initial Setup flow
- Set up Site Kit with GA tracking enabled and check the
Connect Analyticscheckbox during setup. Proceed with the setup until coming back toTell us your main goal to get tailored metrics(Key metrics setup) screen.- When the screen is loaded
setup_flow_v3_view_key_metrics_stepevent will be tracked as described in AC with event category set tokeyMetricsSetup_setup. - When any answer is selected,
setup_flow_v3_select_key_metrics_answerevent will be tracked as described in AC with event category set tokeyMetricsSetup_setup. - When the form is submitted,
setup_flow_v3_complete_key_metrics_stepevent will be tracked as described in AC with event category set tokeyMetricsSetup_setup.
- When the screen is loaded
Without Initial Setup flow
- Set up Site Kit with GA tracking enabled and do not check the
Connect Analyticscheckbox during setup. Proceed with the setup until coming back toTell us your main goal to get tailored metrics(Key metrics setup) screen.- When the screen is loaded
view_key_metrics_stepevent will be tracked as described in AC with event category set tokeyMetricsSetup. - When any answer is selected,
select_key_metrics_answerevent will be tracked as described in AC with event category set tokeyMetricsSetup. - When the form is submitted,
complete_key_metrics_stepevent will be tracked as described in AC with event category set tokeyMetricsSetup.
- When the screen is loaded
Changelog entry
- Add opt-in internal tracking for the new key metrics setup screen.
Metadata
Metadata
Assignees
Labels
P0High priorityHigh priorityTeam MIssues for Squad 2Issues for Squad 2Type: EnhancementImprovement of an existing featureImprovement of an existing feature