Skip to content

Add GA event tracking for the Analytics setup screen #11722

@techanvil

Description

@techanvil

Feature Description

GA events should be added to keep track of interaction with the Analytics 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.
  • Where an event is detailed as replacing a legacy event, the legacy event should no longer be tracked.
  • These changes are only active when the setupFlowRefresh feature flag is enabled.
Event Name Category Trigger Condition Details
setup_flow_v3_view_analytics_step {viewContext}_setup element visibility Analytics setup screen appears replaces view_module_setup in the initial setup flow. In the module setup flow we still track view_module_setup as specified earlier in the sheet
setup_flow_v3_complete_analytics_step {viewContext}_setup click after the user has clicked the setup button, all logic runs successfully replaces complete_module_setup in the initial setup flow. In the module setup flow we still track complete_module_setup
setup_flow_v3_create_analytics_account {viewContext}_setup click user clicks the button to create a new account - ONLY initial setup (NOT module setup) replaces create_account in the initial setup flow. In the module setup flow we still track create_account
_____________________________________________ _______________________ __________________ _________________________________ _____________________________________________

Implementation Brief

  • To determine if the Analytics setup is initiated from the initial setup flow, use the getQueryArg function to determine if the current URL includes the showProgress query argument and setupFlowRefresh feature is enabled.
  • In assets/js/components/setup/ModuleSetup.js

    • In useMount call, if the initial setup flow and moduleSlug is analytic-4, call trackEvent to track the setup_flow_v3_view_analytics_step action according to the ACs. If this condition is not met, the existing view_module_setup event will still be tracked.
    • In finishSetup function, if the initial setup flow and moduleSlug is analytic-4, call trackEvent to track the setup_flow_v3_complete_analytics_step action according to the ACs. If this condition is not met, the existing complete_module_setup event will still be tracked.
  • In assets/js/modules/analytics-4/components/common/AccountCreate/index.js

    • In handleSubmit function, if the initial setup flow is in progress, call trackEvent to track the setup_flow_v3_create_analytics_account action according to the ACs. This will replace current create_account event. If not in the initial setup mode, the existing create_account event will still be tracked.

Test coverage

  • Add tests for these Ga tracking events in ModuleSetup and AccountCreate components' tests.

QA Brief

Changelog entry

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0High priorityTeam MIssues for Squad 2Type: EnhancementImprovement of an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions