Skip to content

Add GA event tracking for the Welcome modal. #12027

@techanvil

Description

@techanvil

Feature Description

GA events should be added to keep track of interaction with the Welcome modal (see #11809).


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_complete_site_setup {viewContext}_setup element visibility welcome modal appears on dashboard after successful setup - ONLY initial setup (NOT module setup) replaces legacy "complete_site_setup"
setup_flow_v3_complete_user_setup {viewContext}_setup element visibility welcome modal appears on dashboard after successful setup (NOT module setup) replaces legacy "complete_user_setup"
view_notice {viewContext}_welcome-modal one of: default (the variant shown when data is available when first landing on the dashboard), gathering_data (the gathering data variant), data_available (the variant shown when the gathering data variant has previously been shown and there is now data) element visibility user views the welcome modal on the dashboard
confirm_notice {viewContext}_welcome-modal one of: default, gathering_data, data_available click user clicks the modal's "Start tour" button, or the "Get started" button shown in the gathering data state
dismiss_notice {viewContext}_welcome-modal one of: default, gathering_data, data_available click user closes the modal by clicking "Maybe later", "X", or outside the modal
tooltip_view {viewContext}_welcome-modal one of: default, gathering_data, data_available element visibility user views the tooltip pointing to the help menu that is shown when closing the modal
tooltip_dismiss {viewContext}_welcome-modal one of: default, gathering_data, data_available click user clicks "Got it" or "X" to close the tooltip
______________________________________ _________________________________ _________________________________________________ __________________ _________________________________ _________________________

Implementation Brief

  • In useGlobalTrackingEffect(), return early from the useEffect() callback if the setupFlowRefresh feature flag is enabled so we no longer track the legacy events.
  • Update the AdminScreenTooltip component to support a gaTrackingEventLabel property which is passed to the trackEvent() call, similar to the tooltipSlug property.
  • Update the WelcomeModal component to track the new events:
    • Use the useIntersection() hook to track when the modal is viewed, and trigger the setup_flow_v3_complete_site_setup, setup_flow_v3_complete_user_setup and view_notice events when the modal is in view.
    • Use similar logic to useGlobalTrackingEffect() to ensure that setup_flow_v3_complete_site_setup and setup_flow_v3_complete_user_setup are only tracked once.
    • Track the confirm_notice and dismiss_notice events in the relevant CTA onClick() handlers.
    • Use the modalVariant state to determine the label for the events.
    • Update the tooltipSettings object to track the tooltip_view and tooltip_dismiss events:
      • Set tooltipSlug to welcome-modal and add the gaTrackingEventLabel property, determined by the modalVariant state.

Test Coverage

  • Extend the tests for useGlobalTrackingEffect(), AdminScreenTooltip and WelcomeModal to cover the above changes.

QA Brief

  • Set up Site Kit with setupFlowRefresh enabled
  • Use a tool like GA Debug to inspect the tracked events in the dev console
  • Ensure that all the events in the AC are tracked correctly
    • setup_flow_v3_complete_site_setup and setup_flow_v3_complete_user_setup should only be tracked once, when the Welcome Modal is shown for the first time.
    • view_notice should be tracked whenever any variation of the Welcome Modal is shown
    • confirm_notice should be tracked whenever the modal is dismissed by clicking the "Start tour" or "Get started" buttons
    • dismiss_notice should be tracked whenever the modal is dismissed by clicking the "Maybe later" or "X" buttons, by pressing Escape or by clicking outside the modal
    • tooltip_view should be tracked when the Help Menu tooltip is displayed after dismissing the modal
    • tooltip_dismiss should be tracked when the Help Menu tooltip is dismissed

Note: You can refer to the QAB of #11909 for instructions on how to trigger each variant of the modal

Changelog entry

  • Add GA event tracking for user interaction with the Welcome modal.

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