Skip to content

Fix Analytics account creation in the new setup flow. #12194

@techanvil

Description

@techanvil

Bug Description

When the user creates an Analytics account and returns to Site Kit, they are redirected to the Key Metrics setup screen.

However, the Complete setup button remains in a disabled, in-progress state and the user cannot proceed to the dashboard.

This is because the background custom dimensions sync results in the propertyID setting being resolved to undefined - the ID is needed for the isSyncing check, which remains stuck as true.

Steps to reproduce

  1. Set up Site Kit with the setupFlowRefresh feature flag enabled, and the Analytics checkbox selected on the splash screen.
  2. Create a new Analytics account as part of the setup flow.
  3. When landing on the Key Metrics setup screen, see that the Complete setup button is disabled and the user cannot proceed to the dashboard.

Additional Context

  • PHP Version: any
  • OS: any
  • Browser: any
  • Plugin Version: 1.172.0
  • Device: any

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • When creating an Analytics account in the new setup flow, the Complete setup button is enabled on the Key Metrics setup screen and the user can proceed to the dashboard.

Implementation Brief

  • In KeyMetricsSetupApp, await the getSettings() resolver for the MODULES_ANALYTICS_4 datastore before triggering the background sync of audiences and custom dimensions.

Test Coverage

  • Update the tests for KeyMetricsSetupApp to cover this change.

QA Brief

  • Follow the steps to reproduce above
  • Ensure that the Complete setup button is not loading/disabled indefinitely
  • Ensure that the background sync is still triggered as before and no regressions were made

Changelog entry

  • Fix Analytics account creation in the new setup flow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0High priorityTeam MIssues for Squad 2Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions