TapCub is live — analytics, insights and live chat, free on one platform
Analytics

How to Optimize CLS: Find the Shifts and Fix the Top Causes in Order

How to optimize CLS: measure in field data, find which elements shift, then fix images, banners, ads, fonts and widgets in order of contribution. Includes a worked example that takes a 0.32 score to 0.02.

Su He Published Nov 23, 2026 13 min read Analytics
Sample data: a product page scores 0.32 at the 75th percentile. Fixing the image, banner and ad slot (in that order) brings it to 0.07, below the 0.1 good threshold.Sample data

To optimize CLS, measure it in real-visitor data, find which elements shift, and fix the biggest contributor first, usually images without dimensions, banners inserted above content, ads with no reserved height and font swaps. In the worked example, three fixes take a 0.32 score under the 0.1 good threshold; the rest of the guide shows how.

What you will learn

  • Good CLS is 0.1 or less at the 75th percentile; decide from field data, find elements with Lighthouse and DevTools
  • Lighthouse often lists the pushed elements, not the cause: look for what arrived late with no space reserved
  • Rank causes by contribution ÷ effort; in the sample, three fixes move 0.32 to 0.07

What does a CLS score actually measure?

Cumulative Layout Shift (CLS) adds up how much visible content jumps around while a page loads and while people use it. Each jump gets a layout shift score:

layout shift score = impact fraction × distance fraction

The impact fraction is the share of the viewport covered by the elements that moved (before and after positions combined). The distance fraction is how far the biggest mover travelled, as a share of the viewport. Sample data: a block of content filling 50% of the viewport height gets pushed down by a late banner by 20% of the viewport. The union of its old and new positions covers 70% of the viewport, so the score is 0.7 × 0.2 = 0.14. One small banner on one load is already past the "good" line.

The thresholds, from Google's web.dev guidance: good is 0.1 or less, poor is above 0.25, and the target is that at least 75% of page visits reach "good" (the 75th percentile, split by mobile and desktop). Two details change how you read the number:

  • Shifts are grouped into session windows: bursts of shifts less than 1 second apart, capped at 5 seconds. The page's CLS is its worst window, not the sum of the whole visit.
  • A shift that happens within 500 milliseconds of a tap or keypress is flagged as expected and left out. A menu that opens on click does not count; a banner that appears three seconds after load does.

If your page is above 0.1 at the 75th percentile, the goal of this guide is simple: find which elements cause the shifts, fix the biggest contributor first, and re-measure after each fix.

RatingCLS (75th percentile)What to do
Good0.1 or lessKeep it there; watch after each release
Needs improvementAbove 0.1, up to 0.25Find the top two causes and fix them first
PoorAbove 0.25Audit every template; fix images and injected content before anything else

Thresholds from Google's web.dev; the target is at least 75% of page visits rated good.

How do you measure CLS before you change anything?

Start with field data, the numbers from real visitors, because lab tools run one scripted load on one device and often show a lower CLS than people experience. Google's own guidance warns that lab results can understate it. You need two numbers per important page: the 75th percentile (P75) and the share of loads rated good.

SourceWhat you getLimit
Real-user monitoring in your analyticsP75 and share rated good, by page, device, countryOnly for visitors whose browser reports it; needs the current script
Lighthouse / PageSpeed auditsOne lab load, plus a list of elements that shiftedOne device, one network; later shifts may be missed
Chrome DevTools Performance panelEach shift with start time, score and the elements involvedYou must reproduce the problem yourself

Write down a baseline before the first fix: for example "product page: P75 CLS 0.32, 38% of loads good, mobile worse than desktop". Without it you cannot tell whether a fix worked or whether traffic simply changed.

How do you find which elements shift?

Work from the page with the worst P75 and use three tools in this order.

  1. Lighthouse "Avoid large layout shifts" lists the elements that shifted and their contribution to CLS. Read it with care: according to web.dev, these are often the elements that were pushed, not the one that caused the push. A paragraph moving down is the symptom; the image above it with no reserved height is the cause.
  2. The Performance panel in Chrome DevTools. Record a load, open the Layout Shifts track and click each shift. The summary shows the start time, the score and the shifted elements. Turn on network throttling and a mobile viewport, because shifts hide on fast connections where everything arrives before first paint.
  3. Field attribution with the web-vitals library. Its attribution build reports which element shifted most for real visitors. This matters for shifts that only happen at certain widths, in certain countries or when a consent banner appears.

When you find a shifting element, ask one question: what arrived late and did not have space reserved? Almost every cause below is a version of that.

What are the common causes of CLS, and what does each fix cost?

The table ranks the usual suspects. "Typical effort" is a planning estimate for a developer who already knows the codebase; it is not a benchmark.

CauseHow to recognise itFixTypical effort
Images, video and iframes without dimensionsText jumps down when a picture loadswidth and height attributes, or CSS aspect-ratio30 minutes per template
Banners and notices inserted above contentConsent bar, promo strip or app banner shoves the page downOverlay it (fixed position) or reserve its height1–2 hours
Ads and embeds of unknown sizeSlot is empty, then fills with a 250 px tall unitmin-height equal to the smallest unit; keep the placeholder if no ad loads1–2 hours
Web font swapHeadline reflows when the font arrivesfont-display: optional or a size-matched fallback; preload the key font1–3 hours
Late-injected widgets and formsA form or related-items block pops in after the articleSkeleton or fixed-height container; load on user action2–4 hours
Animations that move layoutElements slide using top, left or heightAnimate transform instead1 hour

What does a worked fix order look like?

Sample data: a product page has a P75 CLS of 0.32, rated poor. Lighthouse and the Performance panel attribute the shifts to five causes (assume all happen inside one session window, so they add up):

CauseContributionScore after its fix
Hero image with no dimensions0.110.21
Consent banner pushes content down0.080.13
Ad slot with no reserved height0.07 (0.01 left after min-height)0.07
Web font swap0.04 (0.01 left after size-matched fallback)0.04
Related-products widget0.020.02

Check the arithmetic: 0.11 + 0.08 + 0.07 + 0.04 + 0.02 = 0.32. After the image fix 0.32 − 0.11 = 0.21; after the banner 0.21 − 0.08 = 0.13; after the ad slot 0.13 − 0.06 = 0.07; after the font 0.07 − 0.03 = 0.04; after the widget 0.04 − 0.02 = 0.02.

Two points follow from this. First, the page crosses the 0.1 line after three fixes, the ones with the biggest contribution and the least work, so you can stop and ship at that point. Second, order by contribution ÷ effort, not by what is most interesting: the image attribute change takes 30 minutes and removes a third of the problem. Re-measure after each change; if the number does not move, you fixed a symptom.

app.tapcub.com

CLS contribution by cause

sample page, score points
Hero image, no dimensions0.11
Consent banner0.08
Ad slot, no reserved height0.07
Web font swap0.04
Related-products widget0.02
Sample data
Sample data: a product page scores 0.32 at the 75th percentile. Fixing the image, banner and ad slot (in that order) brings it to 0.07, below the 0.1 good threshold.

How do you stop images, video and embeds from shifting?

Give the browser the aspect ratio before the file arrives:

<img src="hero.jpg" width="1200" height="630" alt="…">
img { max-width: 100vw; height: auto; }

With width and height set, modern browsers compute the ratio and reserve the space even when CSS makes the image fluid. For video poster frames and iframes (maps, video embeds) use aspect-ratio: 16 / 9 on the container. For ad slots and embeds whose size varies, set min-height to the smallest size the content can have, so that the worst case is a small shift rather than a big one. If no ad loads, keep the empty box; collapsing it is itself a shift. Content that arrives late should sit lower on the page, where it moves less of the viewport.

How do you handle banners, cookie notices and injected content?

The classic mistake is inserting a bar at the top of the document after the page has painted. Three safe options:

  • Overlay it. A fixed-position bar at the bottom or top of the viewport does not push anything.
  • Reserve the space in the first paint, even if the bar is hidden for returning visitors (accept the empty strip, or render the correct state on the server).
  • Replace content in a fixed-size container rather than inserting new nodes into the flow, or let the user trigger the load with a "Load more" button, which falls inside the 500 ms input window.

Anything your own scripts add (A/B test variants, personalised banners, chat bubbles) belongs in the same audit. A floating chat bubble anchored to the bottom corner does not move layout, but a widget that inserts a block into the page flow does.

How do you stop web fonts from causing shifts?

A fallback font and a web font have different letter widths and line heights, so text reflows when the real font arrives. The options, from simplest to most precise:

  1. font-display: optional shows the web font only if it is ready by the first layout, otherwise keeps the fallback for that visit. No swap, no shift, at the price of some first visits seeing the fallback.
  2. Preload the one or two fonts used above the fold: <link rel="preload" as="font" …>.
  3. Match the fallback to the web font with size-adjust, ascent-override, descent-override and line-gap-override in an @font-face for the fallback, so the two fonts occupy almost identical boxes.

Test on a throttled connection. On a fast one the font arrives before first paint and the problem disappears from your laptop while staying on phones.

Which animations and navigation habits affect CLS?

Animating top, left, height, box-shadow or box-sizing forces layout work and counts as movement. Animate transform (translate, scale, rotate) instead: composited translations do not count toward CLS. Also keep pages eligible for the back/forward cache; when a page is restored exactly as the visitor left it, no new shifts happen on the way back, which matters for category-to-product browsing.

How do you confirm the fix worked?

  1. Re-run the same lab check and confirm the shifted-element list shrank.
  2. Wait for field data. Real-user numbers move slowly because they depend on how many visits have loaded the new code; compare P75 for the same page and device for a week before and after, not day over day.
  3. Check per device. Mobile usually fails first because fonts and ads load later and viewports are smaller.
  4. Mark the release date on your charts so the next person can see which deploy changed the score.

Rule of thumb: if P75 is under 0.1 but "share rated good" is still under 75%, look for a rare shifting path (one country, one browser, a logged-in state) rather than tuning further.

How do you check CLS by page in TapCub?

Continuing the sample page above, this is how you would follow it in TapCub:

  1. Open Monitoring › Performance. The Cumulative layout shift card uses the same thresholds (good at most 0.1, poor above 0.25). Switch the card to P75 and read the share rated good.
  2. Break down by page, then by device or country. This tells you whether the product template, mobile Safari or one market is the problem. The 0–100 score combines LCP, INP and CLS, so use the CLS card itself for this task.
  3. Add a date annotation under Configuration › Annotations when you ship each fix, so the trend line shows which change helped.
  4. Open Monitoring › Errors and the click heatmaps under All-platform analytics › Behavior › Heatmaps for the pages you fixed: people who keep clicking a button that moved away can show up as rage clicks.

TapCub reports the score for each page; it does not name the element that moved, so the root-cause work stays in DevTools or Lighthouse. If the script is blocked or an old snippet is installed, the Performance page is empty, because server time is not substituted. For the full list of speed and stability metrics see website performance metrics, and for broader speed work how to speed up a website. The definition of the metric is in the CLS glossary entry.

FAQ

What is a good CLS score?

A CLS of 0.1 or less is good, above 0.25 is poor, and anything between needs improvement. The target is that 75% of page visits (the 75th percentile, segmented by mobile and desktop) meet the good threshold.

Why is my CLS different in Lighthouse and in field data?

Lighthouse measures one scripted load on a simulated device. Field data covers every real load, including scrolling, late ads, consent banners and slow networks. Trust field data for the pass or fail decision and use Lighthouse to find the elements.

Does CLS include shifts after the user clicks?

Not if they happen within 500 milliseconds of the input; those are marked as user-initiated. Content that takes longer than that to appear after a click still counts, so reserve space for it.

Which fix reduces CLS the most?

On most templates it is missing image dimensions or a banner inserted above existing content. Rank causes by their contribution in your own attribution data and work down the list; the worked example shows how three fixes can remove 0.26 of a 0.32 score.

Does CLS affect SEO?

CLS is one of the three Core Web Vitals, so it is part of Google's page experience signals. Treat it as a tie-breaker rather than the main ranking factor, and fix it because layout jumps also cost clicks and sales.

Sources

  • Google. Cumulative Layout Shift (CLS), web.dev. Thresholds, 75th percentile target, scoring formula, session windows and the 500 ms input exclusion. Checked 2026-11-23.
  • Google. Optimize Cumulative Layout Shift, web.dev. Causes and fixes for images, embeds, injected content, fonts, animations and bfcache; how Lighthouse, DevTools and the web-vitals library report shifted elements. Checked 2026-11-23.
Filed underAnalytics

Was this article helpful?

We use your answers to fix and expand this page.

Su He

Data Analyst

Explores traffic sources, conversion funnels, and retention, using clear metric definitions and concrete examples to explain what the numbers mean.

See CLS by page and device

Track layout shift for real visitors, break it down by page, and mark each fix on the trend.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics