Skip to content

Add GA event tracking for the splash screen and the "Exit setup" buttons on the splash, Analytics setup and Key Metrics setup screens #11721

@techanvil

Description

@techanvil

Feature Description

GA events should be added to keep track of various interactions with the splash screen, and the Exit setup buttons on the splash, Analytics setup and Key Metrics setup screens.


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 Label Trigger Condition Details
setup_flow_v3_tracking_optin splash click user opts into tracking on splash screen replaces legacy tracking_optin
setup_flow_v3_skip_to_viewonly splash click user clicks on button to skip setup and go directly to view-only dashboard replaces legacy skip_setup_to_viewonly
setup_flow_v3_start_site_setup {viewContext}_setup click user clicks button on splash screen to start - ONLY initial setup, i.e. connecting the site replaces legacy start_site_setup
setup_flow_v3_start_user_setup {viewContext}_setup click user clicks button on splash screen to start setup replaces legacy start_user_setup
setup_flow_v3_start_with_analytics {viewContext}_setup click user starts setup with Analytics checkbox enabled on splash screen replaces legacy start_setup_with_analytics
setup_flow_v3_exit_setup one of splash or {viewContext}_setup current step: splash, analytics, or key-metrics click user clicks the "Exit setup" button on the splash screen, Analytics setup screen, or Key Metrics setup screen
_________________________________________ _______________________ ________________________ ________ _____________________________________________ _______________________________

Implementation Brief

  • In assets/js/components/OptIn.js

    • Accept an additional prop gaTrackingEventArgs which should be an object like existing existing notification components containing category and action.
    • Remove trackEventCategory prop as it won't be required and will be replaced by gaTrackingEventArgs.category, if the category is not available it should default to viewContext as it is currently.
      • If the action is not present, it should default to tracking_optin as it is currently.
  • In assets/js/components/setup/SetupUsingProxyWithSignIn/Actions.js

    • Pass gaTrackingEventArgs prop where category would be splash and action would be setup_flow_v3_tracking_optin, if setupFlowRefresh is enabled.
    • In the goToSharedDashboard method, call trackEvent to track the setup_flow_v3_skip_to_viewonly action, according to the ACs, if setupFlowRefresh is enabled. This should replace the legacy skip_setup_to_viewonly (in the case where the feature is enabled).
  • In assets/js/components/setup/SetupUsingProxyWithSignIn/index.js

    • In the onButtonClick method, call trackEvent to track the setup_flow_v3_start_site_setup action, according to the ACs, if setupFlowRefresh is enabled. This should replace the legacy start_site_setup (in the case where the feature is enabled).
      • Do the same for setup_flow_v3_start_user_setup; it should replace the legacy start_user_setup (in the case where the feature is enabled).
      • If connectAnalytics is true and the setupFlowRefresh feature is enabled, call trackEvent to track the setup_flow_v3_start_with_analytics action, according to the ACs. It should replace the legacy start_setup_with_analytics.
  • In assets/js/components/setup/ExitSetup.js

    • Accept a new prop, onClick, which should be a function.
    • If onClick is present, call the onClick function in the handleClick method.
  • Pass the onClick prop to the ExitSetup component in the following components:

    • assets/js/components/key-metrics-setup/KeyMetricsSetupApp.js
      • Call trackEvent with:
        • label set to key-metrics.
        • Category set to {viewContext}_setup
    • assets/js/components/setup/SetupUsingProxyWithSignIn/Header.js
      • Call trackEvent with:
        • label set to splash.
        • Category set to {viewContext}
    • assets/js/components/setup/ModuleSetup.js
      • Pass moduleSlug as the label.
      • Pass category as {viewContext}_setup

Test coverage

  • Add tests for the GA tracking event in the relevant components' tests.

QA Brief

  • Enable the setupFlowRefresh feature flag, and verify that the events are tracked correctly according to the AC.
  • Verify that the events identified as legacy in the AC are still tracked when the feature flag is disabled.

Changelog entry

  • Add opt-in GA tracking as part of the new setup flow in the splash, Analytics, and Key Metrics setup screens.

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