-
Notifications
You must be signed in to change notification settings - Fork 326
Open
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
Changelog entry
Metadata
Metadata
Assignees
Labels
P0High priorityHigh priorityTeam MIssues for Squad 2Issues for Squad 2Type: EnhancementImprovement of an existing featureImprovement of an existing feature