If text suddenly jumps down while you read an article and you tap the wrong thing, you have met CLS (Cumulative Layout Shift). Google measures it as one of the Core Web Vitals and treats a value below 0.1 as good. On news portals, classifieds and blogs the most common cause of these jumps is ad banners. The banner loads after the text has rendered, claims its space and pushes everything below it down.
Why ad slots move the page
Ad network scripts usually run asynchronously: the page renders first, then the script calls its server, an auction runs, and only then is the banner inserted. This can take from a few hundred milliseconds to several seconds, longer on slow mobile connections. If the container has no reserved height, it starts at zero and grows to 90, 250 or 600 pixels when the ad arrives. The browser records that as an unexpected shift and adds it to CLS.
It gets worse because one slot can receive banners of different sizes: 300x250 today, 300x600 tomorrow, sometimes nothing at all, and the slot collapses. Banners at the very top, on the first screen, do the most damage, since the whole article sits beneath them.
A Tashkent news site as an example
Imagine a small Tashkent news site, misol.uz, that places a 728x90 banner under every headline and a 320x100 banner on mobile. PageSpeed Insights field data shows mobile CLS around 0.35. Chrome DevTools reveals that the banner container is an empty div with no dimensions, so when the ad arrives the first paragraph drops by 100 pixels just as the reader starts reading. Giving the container a minimum height equal to the most common banner, and keeping that space even when no ad is served, brought field CLS down noticeably within a few weeks, with no loss in revenue because the number and placement of slots stayed the same.
Reserve the space up front
The most effective fix is to give the ad container an explicit size, or at least a min-height, in CSS. The browser then knows about the empty area on first render and the ad does not push anything. Use media queries when devices need different sizes.
/* Space for the ad is reserved in advance */
.ad-slot {
display: block;
width: 100%;
max-width: 728px;
min-height: 90px;
margin: 0 auto 16px;
background: #f3f4f6;
}
.ad-slot--sidebar {
width: 300px;
min-height: 250px;
}
@media (max-width: 767px) {
.ad-slot {
max-width: 320px;
min-height: 100px;
}
}
A light grey background or a small "Advertisement" label keeps the empty area from looking broken, and it is honest with readers too.
Slots that receive several sizes
Check your ad statistics and reserve the most frequently served height. A larger banner will still cause a shift, but a smaller one. Reserving the largest size and centring smaller creatives is the safest option for CLS, at the cost of more empty space.
Do not collapse empty slots
Hiding an unfilled slot with JavaScript after load is also a shift, because the content below moves up. Leave the space or fill it with a house ad, such as a static banner promoting your own services.
Sticky and floating banners
A banner pinned to the bottom of the screen does not affect CLS if it is taken out of the document flow with position: fixed. Add matching bottom padding to the body so text is not hidden underneath.
.ad-sticky-bottom {
position: fixed;
left: 0;
right: 0;
bottom: 0;
height: 60px;
z-index: 50;
}
body {
padding-bottom: 60px;
}
Announcement bars, cookie notices and "get the app" banners that slide in from the top follow the same rule: if they push content down, they are a classic CLS source.
Finding and measuring shifts
Ad-related shifts often do not appear in a single Lighthouse lab run, because the ad may not load during the test. Rely on field data in PageSpeed Insights and the Core Web Vitals report in Search Console. Locally, record a trace in the Chrome DevTools Performance panel and look at the "Layout shifts" track, or paste this into the console to log each shift and its source:
new PerformanceObserver((list) => {
for (const entry of list.getEntries()) {
if (!entry.hadRecentInput) {
console.log('CLS:', entry.value.toFixed(4), entry.sources);
}
}
}).observe({ type: 'layout-shift', buffered: true });
If your ad container or the element below it shows up in sources, you have found the cause. Repeat the test with mobile emulation and network throttling, where ads arrive latest.
Lazy-loading ads safely
Loading lower banners only when the user scrolls near them helps speed, but the container still needs a reserved height. Shifts within 500 ms of user input are excluded from CLS, yet scrolling does not count as such input, so an ad that expands mid-scroll is counted. Fast hosting close to your audience delivers the page quickly, but CLS is a front-end problem that only correct HTML and CSS can solve, so plan ad slots at the design stage.