Reduce ad-related layout shift
Stay organized with collections
Save and categorize content based on your preferences.
Overview
Cumulative Layout Shift measures the total amount of user-visible layout shift
using the Layout Instability API
by summing the layout shift score for
all layout shifts where the ad iframe shifted or caused the layout shift.
Recommendations
This metric is not indicative of a specific issue. It should be used to help
identify areas for improvement and track that improvement over time.
To avoid layout shift, it's important to set sizes for ad elements before the
ad tag loads. This can be difficult or impossible to do perfectly—especially for
ad slots that accept dynamically sized ads—but there are best practices you can
follow to minimize layout shift in most cases. For more information, see the
guide to minimizing layout shift
at the GPT developer site.
Cumulative Layout Shift (CLS)
Optimize Cumulative Layout Shift
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-26 UTC."],[[["Cumulative Layout Shift (CLS) quantifies the total visual instability caused by ad iframes shifting or inducing layout changes, using the Layout Instability API and layout shift scores."],["This metric helps pinpoint areas for improvement and track progress rather than diagnosing specific issues."],["Minimizing layout shift is crucial and involves pre-setting ad element sizes, though achieving perfection is challenging, especially with dynamic ads."],["Refer to the GPT developer guide for best practices in minimizing layout shift for most scenarios."]]],[]]