You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the dashboard tour shown when Analytics is connected expects both the Key Metrics and Audience Segmentation features to be set up, as it includes steps for each of them. This means the tour doesn’t work properly when either feature is not set up.
To address this, when these features aren't set up, their steps will be removed from the tour, and the Top Search Queries step from the Search Console-only tour will be shown instead. It will be positioned before the Top Content step in the tour.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Given that a user sets up Site Kit and connects Analytics without the setupFlowRefresh feature flag enabled, and then enables the feature flag and triggers the dashboard tour:
If either the Key Metrics or Audience Segmentation features are not set up:
In assets/js/modules/analytics-4/datastore/audience-settings.js
Add a new isAudienceSegmentationSetupCompleted() selector for consistency with CORE_SITE.isKeyMetricsSetupCompleted(). Wrap the existing getAudienceSegmentationSetupCompletedBy() selector using the negateDefined helper from @/js/util/negate so the new selector returns:
undefined if audience settings aren't loaded yet
false if audienceSegmentationSetupCompletedBy is null/0/falsy
In assets/js/feature-tours/hooks/useWelcomeTour.ts
Read both setup-completion selectors and pass the results into getWelcomeTour:
select( CORE_SITE ).isKeyMetricsSetupCompleted()
select( MODULES_ANALYTICS_4 ).isAudienceSegmentationSetupCompleted() (the new selector)
Coerce each to a strict boolean before passing (mirroring the existing !! isAnalyticsConnected pattern in the same file). Treat undefined (not-yet-loaded) the same as false for tour-step purposes — i.e. omit the step rather than show it against a not-yet-rendered widget.
In assets/js/feature-tours/welcome.ts
Extend the getWelcomeTour parameter object with two new required booleans: isKeyMetricsSetupCompleted and isAudienceSegmentationSetupCompleted. Update both the inline destructure and the inline type annotation accordingly.
In the Analytics-connected branch (the return { slug: WELCOME_TOUR.WITH_ANALYTICS, ... } block), build the steps array conditionally instead of inlining the four steps:
Always include the All Traffic step.
Include the Key Metrics step only ifisKeyMetricsSetupCompleted === true.
Include the Audience Segmentation step only ifisAudienceSegmentationSetupCompleted === true.
Include the Top Content step (always).
If either isKeyMetricsSetupCompleted or isAudienceSegmentationSetupCompleted is false, insert the Top Search Queries step immediately before the Top Content step. Insert it only once, regardless of whether one or both of KM/AS are missing.
Preserve the existing step order: [ Key Metrics?, All Traffic, Audience Segmentation?, ( Top Search Queries )?, Top Content, Dashboard Sharing ].
The Top Search Queries step should be identical to the one used in the SC-only tour (second step of the ! isAnalyticsConnected branch in the same file) — same target, floaterProps.target, title, content, offset, spotlightPadding, placement, and isResponsive. Extract it into a shared getTopSearchQueriesStep() helper function (similar to the existing getDashboardSharingStep and getActivateAnalyticsStep helpers) and call it from both branches to avoid duplication.
Keep the existing getDashboardSharingStep( isViewOnly, canAuthenticate, true ) call as the final step in the Analytics-connected branch.
Test Coverage
Add tests for the new isAudienceSegmentationSetupCompleted selector in assets/js/modules/analytics-4/datastore/audience-settings.test.js.
Update tests for getWelcomeTour in assets/js/feature-tours/welcome.test.ts to cover the KM/AS setup-completion permutations.
Update tests for useWelcomeTour in assets/js/feature-tours/hooks/useWelcomeTour.test.ts to verify the new selector values are passed through to getWelcomeTour.
QA Brief
Set up Site Kit with Analytics and without setupFlowRefresh
Enable setupFlowRefresh after the setup is complete
Run the dashboard tour and ensure that there are no missing steps
Ensure that the Top Search Queries step is shown when either Key Metrics or Audience Segmentation are not set up
Enable Key Metrics and ensure that its step is now included in the tour
Enable Audience Segmentation and ensure that its step is now included in the tour
Ensure that the Top Search Queries step is no longer part of the tour when both features are enabled
Ensure that these two features' respective widgets are not displayed when they're toggled off:
Toggle off "Visitor groups" from admin settings
Toggle off "Display key metrics in dashboard" from admin settings (you need to disable setupFlowRefresh then enable it back)
Changelog entry
Substitute a Top Search Queries step in the dashboard tour when Key Metrics or Audience Segmentation are not yet set up.
Feature Description
Currently, the dashboard tour shown when Analytics is connected expects both the Key Metrics and Audience Segmentation features to be set up, as it includes steps for each of them. This means the tour doesn’t work properly when either feature is not set up.
To address this, when these features aren't set up, their steps will be removed from the tour, and the Top Search Queries step from the Search Console-only tour will be shown instead. It will be positioned before the Top Content step in the tour.
For reference, see the replace missing steps in the dashboard tour section in the design doc.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
setupFlowRefreshfeature flag enabled, and then enables the feature flag and triggers the dashboard tour:Implementation Brief
See the implementation guide in the design doc.
In
assets/js/modules/analytics-4/datastore/audience-settings.jsisAudienceSegmentationSetupCompleted()selector for consistency withCORE_SITE.isKeyMetricsSetupCompleted(). Wrap the existinggetAudienceSegmentationSetupCompletedBy()selector using thenegateDefinedhelper from@/js/util/negateso the new selector returns:undefinedif audience settings aren't loaded yetfalseifaudienceSegmentationSetupCompletedByisnull/0/falsytrueif it's a truthy user IDassets/js/googlesitekit/datastore/site/info.js):In
assets/js/feature-tours/hooks/useWelcomeTour.tsgetWelcomeTour:select( CORE_SITE ).isKeyMetricsSetupCompleted()select( MODULES_ANALYTICS_4 ).isAudienceSegmentationSetupCompleted()(the new selector)booleanbefore passing (mirroring the existing!! isAnalyticsConnectedpattern in the same file). Treatundefined(not-yet-loaded) the same asfalsefor tour-step purposes — i.e. omit the step rather than show it against a not-yet-rendered widget.In
assets/js/feature-tours/welcome.tsgetWelcomeTourparameter object with two new required booleans:isKeyMetricsSetupCompletedandisAudienceSegmentationSetupCompleted. Update both the inline destructure and the inline type annotation accordingly.return { slug: WELCOME_TOUR.WITH_ANALYTICS, ... }block), build thestepsarray conditionally instead of inlining the four steps:isKeyMetricsSetupCompleted === true.isAudienceSegmentationSetupCompleted === true.isKeyMetricsSetupCompletedorisAudienceSegmentationSetupCompletedisfalse, insert the Top Search Queries step immediately before the Top Content step. Insert it only once, regardless of whether one or both of KM/AS are missing.[ Key Metrics?, All Traffic, Audience Segmentation?, ( Top Search Queries )?, Top Content, Dashboard Sharing ].! isAnalyticsConnectedbranch in the same file) — sametarget,floaterProps.target,title,content,offset,spotlightPadding,placement, andisResponsive. Extract it into a sharedgetTopSearchQueriesStep()helper function (similar to the existinggetDashboardSharingStepandgetActivateAnalyticsStephelpers) and call it from both branches to avoid duplication.getDashboardSharingStep( isViewOnly, canAuthenticate, true )call as the final step in the Analytics-connected branch.Test Coverage
isAudienceSegmentationSetupCompletedselector inassets/js/modules/analytics-4/datastore/audience-settings.test.js.getWelcomeTourinassets/js/feature-tours/welcome.test.tsto cover the KM/AS setup-completion permutations.useWelcomeTourinassets/js/feature-tours/hooks/useWelcomeTour.test.tsto verify the new selector values are passed through togetWelcomeTour.QA Brief
setupFlowRefreshsetupFlowRefreshafter the setup is completeTop Search Queriesstep is shown when either Key Metrics or Audience Segmentation are not set upTop Search Queriesstep is no longer part of the tour when both features are enabledsetupFlowRefreshthen enable it back)Changelog entry