Fixing layout shift from embeds and late-loading banners
Short answer: Reserve space for embeds and promo banners—CLS spikes when late content pushes paragraphs down after users start reading.
Cookie banners, review widgets, and announcement bars are frequent culprits on NZ retail sites.
Fix patterns
- Fixed-height containers for iframes with aspect-ratio CSS.
- Load non-critical banners after first paint with reserved skeleton space.
- Avoid injecting large DOM nodes above main content without layout reservation.
Test realistically
Throttle CPU in devtools; test with ad blockers off if your audience uses them rarely.
Coordinate marketing
Give developers banner dimensions and timing rules before campaigns go live.
Frequently asked questions
Do cookie banners always hurt CLS?
Not if they slide in without resizing the whole viewport awkwardly—design matters.
What about dynamic ads?
Set max dimensions and fallbacks; unpredictable ad sizes are hard—consider static promo slots.