Chapter 4. Understanding Layout Shift and Ads

Lazy Loading

Reserving space solves layout shift. Lazy loading solves the other cost of ads: their weight.

Without lazy loading, the AdSense script starts downloading as soon as the page does, and asks for every ad on the page at once, including the ones at the very bottom. That work competes with your own content for the visitor's connection and processor. It can delay your Largest Contentful Paint and make the page slower to respond to the first tap.

With lazy loading, which is on by default, CLS Ad Slot leaves AdSense out of the page entirely while it loads. It only loads the AdSense script when the first slot comes within about 400 pixels of the visible part of the page, and it asks for each ad only as its slot comes near. A visitor who reads the first screen and leaves never downloads AdSense at all. The 400-pixel head start means an ad is usually ready by the time it scrolls into view.

Note

The reserved space doesn't depend on lazy loading. Even with lazy loading off, every slot keeps its space from the start.

On This Page