Ensure cached audiences are resynced when the No Audiences Banner is shown #9214
Closed
6 tasks done
Labels
Module: Analytics
Google Analytics module related issues
P1
Medium priority
Team M
Issues for Squad 2
Type: Enhancement
Improvement of an existing feature
Feature Description
At present, when the conditions are met for showing the No Audiences Banner, the list of cached audiences will no longer be synced periodically. We should ensure they continue to be synced, showing the appropriate loading state while the sync is in progress.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
In order to synchronise the display of the No Audiences Banner with the Audience Tiles loading state, we'll remove the registration of
NoAudiencesBannerWidget
as a standalone widget, and instead render it inline inAudienceTilesWidget
.AudienceTilesWidget
:await
the call tomaybeSyncAvailableAudiences()
, ensuringavailableAudiencesSynced
is not set until the available audiences have completed their sync. This ensures the loading state will persist until the audiences have synced.site-kit-wp/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/index.js
Lines 52 to 55 in f13fb02
WidgetNull
when there is no matching audience:site-kit-wp/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/index.js
Lines 66 to 68 in f13fb02
WidgetNull
.availableAudiencesSynced
istrue
, renderNoAudiencesBannerWidget
.site-kit-wp/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/SecondaryUserSetupWidget/index.js
Lines 75 to 84 in f13fb02
modules/analytics-4/index.js
:NoAudiencesBannerWidget
widget.isActive()
condition for theAudienceTilesWidget
to be a check for!! configuredAudiences
.site-kit-wp/assets/js/modules/analytics-4/index.js
Lines 138 to 142 in f13fb02
Test Coverage
AudienceTilesWidget
.QA Brief
Enable audience segmentation feature and enable the visitor groups. Property should have the Site Kit audience created (New visitors and Returning visitors), if not, create them.
Add "New Visitors" and "Returning Visitors" tiles in dashboard using audience selection panel.
In tester plugin settings,
Analytics > Force Analytics Audiences
, selecthas-no-site-kit-created-audiences
and save.Go to SK dashboard, there should be a no audience banner displayed in audience tiles area.
Install Time Travel extension in chrome.
Set the time in extension to more than 1 hour later.
Refresh the dashboard and notice in network tab, there should be a request sent to
sync-audiences
endpoint. When you disable the extension, there should be no request to the endpoint if done within an hour.To verify that two loading tiles are shown when audiences are being synced, set the network throttling in chrome to 3G. Enable Time Travel extension and refresh the SK dashboard. You should see two loading audiences tiles when
sync-audiences
request is being processed.Changelog entry
The text was updated successfully, but these errors were encountered: