Skip to the indexed answers
Digital Marketing Index

usdigitalmarketingindex.com SEO

How can ad placements be adjusted to reduce Cumulative Layout Shift?

Reserve the space for each ad before it loads, so that content below it does not move when the ad arrives. The main mechanism of ad layout shift is simple: a container starts at zero height, the ad is fetched, and the container expands, pushing everything after it down the page. Giving the container a fixed or minimum height in CSS removes the expansion. web.dev lists “Ads, embeds, and iframes without dimensions” among the main causes of layout shift, and gives the target as a CLS of 0.1 or less (web.dev’s guide to optimizing CLS). Reservation cannot always be exact, because the size of the creative that wins an auction is not known in advance. The aim is to make shifts small and rare, not to promise zero.

Ad slot reservation

A slot that causes a shift:

<div id="ad-top"></div>
<article>
  <h1>Article headline</h1>
  <p>First paragraph.</p>
</article>

The container has no height. When a 250-pixel-tall ad fills it, the headline and everything below jump down by 250 pixels.

The same slot with space reserved:

<div id="ad-top" class="ad-slot"></div>
<article>
  <h1>Article headline</h1>
  <p>First paragraph.</p>
</article>
.ad-slot {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  #ad-top.ad-slot {
    min-height: 90px;
  }
}

The container holds 250 pixels on small screens and 90 pixels on wider ones, matching the sizes configured for that slot at each breakpoint. When the ad arrives it fills space that was already there.

Use the media query to mirror the ad configuration. A slot that serves a tall unit on phones and a short banner on desktop needs a different reservation at each width.

Creative size variability

A slot configured for several sizes cannot be reserved perfectly. Choose by the data.

Approach Effect Cost
Reserve the largest configured size No expansion shift Empty space when a smaller creative serves
Reserve the size that serves most often, from ad server reports Small shift on the remaining impressions Needs data, and occasional shifts remain
Restrict the slot to one size No shift May reduce demand for the slot
Reserve the smallest size Shift on most impressions Little benefit

For slots near the top of the page, where a shift moves the content a visitor is starting to read, prefer the first or third approach. For slots far down the page, the second is a reasonable compromise.

Say what you do not know. If the slot accepts sizes you cannot predict, the reservation is an estimate, and some shift will remain.

Late insertion

Reservation handles ads that load into an existing slot. Other behaviors cause shifts too.

  • Slots injected by script. If the container itself is added after load, into the middle of content, reservation in CSS comes too late. Put the container in the HTML.
  • Collapsing empty slots. When no ad is returned and the container collapses, content jumps up. Keep the reserved space, or show a placeholder, unless the slot is known to be empty before anything renders.
  • Sticky and overlay units. An ad that animates in over the page does not shift layout if it is positioned outside the document flow. One that pushes the page to make room does.
  • Ads that resize after loading, such as expanding units, shift content again.

Where the unit is placed matters as much as how. A shift is weighted by how much of the viewport moves and how far. An ad at the very top of the page that loads late moves the entire screen. The same ad below the first screen moves content the visitor has not reached, and if it loads before they scroll to it, they never see the shift.

Before-and-after CLS verification

Trace the source before changing anything.

  1. Record a page load in a browser’s performance panel, with network throttling so that ads arrive late.
  2. Open the layout shift entries. Each lists the elements that moved and the score.
  3. Identify the element whose size change caused the move. For an ad shift, it is the slot container growing.
  4. Note the score contributed by each shift.

A record for one page, with invented figures for illustration:

Shift source Before After reservation
Top slot expands from 0 to 250 px 0.18 0.00
In-article slot expands from 0 to 280 px 0.09 0.00
In-article slot serves a 250 px creative in a 280 px reservation Not applicable 0.00, with 30 px of empty space
Footer slot collapses when unfilled 0.02 0.02, not yet addressed
Total 0.29 0.02

The invented example moves from poor to within the 0.1 target, with one source left over.

Then confirm with real visits. Lab runs load ads differently from real sessions: test accounts, consent states, and ad fill all vary. Watch the Core Web Vitals report in Search Console for the affected page group, and your own real-user monitoring if available. Google’s stated target is “a CLS score of less than 0.1” (Google’s documentation on Core Web Vitals), assessed on field data.

Check the commercial side as well. Compare viewability and revenue for the changed slots before and after, so that a layout improvement is not bought with an unnoticed loss.

Checklist:

  • Every ad container exists in the HTML, not injected later.
  • Every container has a reserved height at each breakpoint.
  • Reserved sizes match what the ad server is configured to deliver.
  • Unfilled slots do not collapse after rendering.
  • No ad is inserted above content the visitor is already reading.

Full-screen overlays that cover the content are a different problem from layout shift, with their own guidance from Google, discussed in the guide to when intrusive mobile pop-ups can interfere with search usability.

The rule: the space an ad will take should exist before the ad does.

Link trail

Reader comments on this answer

Add your comment to this answer

Your email address will not be published. Required fields are marked *