-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid layout shift when showing the Setup CTA Banner. #8707
Comments
Hey @ankitrox, this IB is looking good. A few points:
|
Hi @techanvil , Thank you for reviewing IB. I have made the suggested changes in IB and updated the estimate to 11 points as I agree with what you mentioned regarding the time which we have to spend across the workflow. Assigning this to you for IB review again. Thank you. |
Thanks @ankitrox. The IB was mostly LGTM, however I have tweaked it for brevity and to correct a minor mistake. Please review the changes and feel free to move it to the EB if you are happy with it. |
Thank you @techanvil . Moving this to EB as everything seems fine to me. |
Feature Description
The initial integration of the Setup CTA Banner (see #8131) results in a layout shift when showing the banner, as the conditions for showing it are not known immediately upon page load.
We should investigate and implement a mechanism for avoiding this layout shift where possible.
A useful side effect of this would be to reduce the number of times we need to request a report for determining the conditions for showing the banner.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
1. Audience settings
/modules/analytics-4/data/audience-settings
inincludes/Modules/Analytics_4.php
inside register method usinggooglesitekit_apifetch_preload_paths
hook. This would make the audience settings data readily available on the page.2. Analytics Report
AudienceSegmentationSetupCTAWidget
component:analytics-4
module. This can be achieved by doing the same thing as that of theKeyMetricsSetupCTAWidget
component here.hasDataWithinPast90Days
check as we no longer need it.null
ifconfiguredAudiences
is truthy orundefined
, or theisDataAvailableOnLoad
selector returnsfalse
.Test Coverage
AudienceSegmentationSetupCTAWidget
component:configuredAudiences
returns a truthy orundefined
value. In such cases, the component should not render anything.isDataAvailableOnLoad
selector returnsfalse
. In such case, the component should not render anything.configuredAudiences
isnull
andisDataAvailableOnLoad
returnstrue
. In such case, the component should render the setup CTA banner.QA Brief
Go to https://myaccount.google.com/connections and remove permissions for "Site Kit".
Disconnect Site Kit from in wp-admin and re-connect the Site Kit. This will effectively reset the Google analytics settings so that banner should be visible.
Go to the Site Kit dashboard page. Check in browser console under "Network" tab, there should be no request for
audience-settings
for/modules/analytics-4/data/audience-settings
path, as this path is preloaded. This behaviour can also be verified by running following command in browser console. The results should be immediately available, withoutundefined
.true
, banner should be visible, else hidden.Changelog entry
The text was updated successfully, but these errors were encountered: