Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Embeds resizing after load (CLS): how to find and fix it

PRF-029Medium impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

Cumulative Layout Shift (CLS) is a score for how much visible content moves while a page loads. An embed is a block of content served by another site, such as a YouTube video, an Instagram post or a reviews widget. If the page does not know the embed's size in advance, it shows nothing or a tiny box. When the embed finishes loading, it expands and pushes everything below it down.

How an embed shift unfolds
  1. Page paintsEmbed area is 0 px or a small placeholder
  2. Visitor starts readingForm and button sit just below the embed
  3. Embed loadsWidget grows to 400 px or more
  4. Content jumpsForm and CTA are pushed down
  5. Tap or click missesVisitor hits the wrong element or gives up

The page renders without knowing the embed's height, then the embed expands and moves the form below it.

Why it costs you leads or sales

When content jumps, people lose their place. A visitor about to tap a button may tap something else, or the button moves out of view. On mobile, where embeds are tall relative to the screen, the effect is larger. A poor CLS score can also count against you in Google's page experience signals, though it is one factor among many.

CLS contribution by page elementExample numbers
CLS contribution by page element (example)Hero image: 0 CLS score; Web font swap: 0 CLS score; YouTube embed: 0.1 CLS score; Reviews widget: 0.1 CLS score001000.10.1Hero imageWeb font swapYouTube embedReviews widgetCLS score

Example: a landing page where the reviews widget alone pushes the page over the 0.1 limit. Your numbers will differ.

How to check if your site has it

Find the embed that moves
  1. Run PageSpeed Insights

    Test the page on mobile at pagespeed.web.dev. Open the Diagnostics list and look for 'Avoid large layout shifts'. It names the elements that moved.

  2. Record it in Chrome DevTools

    Open DevTools, go to Performance, tick Screenshots, record a page load and look for red 'Layout Shift' markers. Click one to see which node moved.

  3. Turn on Layout Shift Regions

    In DevTools, open the three-dot menu, then More tools, then Rendering, and tick 'Layout Shift Regions'. Reload and watch for blue flashes around the embed and the content below it.

  4. Throttle the network

    Set the Network tab to 'Fast 4G' or 'Slow 4G' and reload. Slow loading makes late embed resizing easy to see.

  5. Inspect the embed container

    Right-click the embed, choose Inspect, and check whether the wrapper has a width, height or aspect-ratio before load. If it has none, that is your cause.

How to fix it

The principle is the same everywhere: tell the browser how much space the embed needs before it loads. Videos have a known shape (usually 16:9), so use aspect-ratio. Widgets such as reviews have no fixed shape, so use a min-height close to their typical loaded height.

YouTube iframe with reserved spacehtml
<div style="aspect-ratio: 16 / 9; width: 100%; max-width: 640px;">
  <iframe
    src="https://www.youtube.com/embed/VIDEO_ID"
    width="640" height="360"
    style="width: 100%; height: 100%; border: 0;"
    loading="lazy"
    title="Video title"
    allowfullscreen></iframe>
</div>
Reserve space for a widget that loads latecss
.reviews-widget {
  min-height: 420px; /* set to the widget's typical loaded height */
}
@media (max-width: 600px) {
  .reviews-widget {
    min-height: 640px; /* widgets are often taller on mobile */
  }
}
Reserve space by platform
  1. Use the native video block

    Embed videos with the core YouTube block, which wraps them in a responsive 16:9 container. Avoid pasting raw iframes with fixed heights into the Classic block.

  2. Wrap widget shortcodes

    Put the reviews shortcode in a Group block, give it a CSS class under Advanced, then add a min-height rule for that class in Appearance, Customize, Additional CSS.

Embed handling

Before

  • Embed has no size until it loads
  • Form and button jump down when it appears
  • CLS above 0.1 on mobile

After

  • Container holds the space from first paint
  • Content below stays in place
  • CLS back under 0.1

How to confirm it's fixed

Confirmation checks
  • Reload with Layout Shift Regions on and see no blue flash around the embed area
  • Record a Performance trace and see no layout shift entries tied to the embed
  • Re-run PageSpeed Insights on mobile and check CLS is 0.1 or lower
  • Test on a real phone over mobile data, not only on desktop
  • Check with the embed's content both short and long, such as a short and a long review

How to prevent it happening again

Prevention habits
  • Give every new embed a sized container before it goes live
  • Place late-loading widgets below forms and main CTAs
  • Retest CLS after changing a reviews app, theme or video provider
  • Use lazy loading only for embeds below the first screen, and still reserve their space
  • Keep a list of third-party widgets on key pages so you know what to check

How FunnelGuard handles this

FunnelGuard detects this issue only partly. It checks CLS only: when its robot visitor runs your journey, it can show that layout shift is high on a step. It does not tell you which embed caused the shift, and it does not check how each individual widget is sized.

To cover the rest by hand, use the steps above: run PageSpeed Insights, record a DevTools trace with Layout Shift Regions on, and inspect the container of each embed on your key pages. Do this after you add or change any embed. FunnelGuard's Free plan covers 1 site and 2 journeys with daily checks and no card, and paid plans have a 3-day free trial.

Questions people ask

Why does my YouTube embed make the page jump?

The iframe has no reserved space, so the page lays out content below it first. When the player loads, it takes its full height and pushes everything down. Wrap it in a container with aspect-ratio: 16 / 9 and the jump goes away.

How do I stop an Instagram embed causing layout shift?

Wrap the embed in a container with a min-height close to its typical loaded height. Instagram embeds vary with caption length, so also place them below your form and main button, where any small shift cannot move them.

Why is my reviews widget causing a high CLS score?

Reviews widgets usually load by JavaScript after the page, then insert content of unknown height. Set a min-height on the widget's wrapper matching its loaded size, on both desktop and mobile, so the space is held in advance.

What is a good CLS score?

Google treats a CLS of 0.1 or lower as good. Scores above 0.25 are considered poor. Check your score in PageSpeed Insights or Chrome DevTools.

Does lazy loading an iframe fix layout shift?

No. Lazy loading delays the request but does not reserve space. You still need width and height attributes, an aspect-ratio or a min-height so the area is held before the embed loads.

How do I find which embed is causing layout shift?

Open Chrome DevTools, go to Rendering and tick Layout Shift Regions, then reload the page. The area that flashes blue is shifting. The Performance panel's Layout Shift entries also name the moved element.

Can FunnelGuard tell me which embed is shifting my page?

No. FunnelGuard checks CLS only, so it can show that a step has high layout shift but not which embed caused it. Use DevTools or PageSpeed Insights to find the specific element.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: CLS only.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.