29.06.2022
4550

CLS

Vadym Rudenko
Author at ApiX-Drive
Reading time: ~3 min

CLS (Cumulative Layout Shift) is a score that measures how much content has moved on the screen after it has been rendered.

Roughly speaking, this term describes the situation when the text readable on the screen shifts due to the fact that other elements of the page have loaded. Since the user may lose the place where he read, this situation causes nothing but irritation. It is also not uncommon for situations when the wrong button is pressed, because at the time of pressing the page elements were shifted.

CLS is specified as a percentage showing the offset viewport. Accordingly, the higher the score, the worse. After all, even small shifts can irritate the user.

The main reasons for this effect may be "heavy" images and dynamic advertising. In the early days of the Internet, when computer screen sizes were more or less the same, it was considered good practice to specify height and width attributes for image tags. As a result, the browser reserved space for the image, which could take several minutes to load (speeds in the dial-up years were quite slow) and the text did not move.

Today, when there are a huge number of the most diverse screens in the world, sites can no longer be static, adaptive design has become the norm. The problem is that the browser must start downloading the image in order to determine its dimensions and allocate the correct place for it on the page. The text loads first, but often jumps around as the page reflows to fit the images.

Connect applications without developers in 5 minutes!
Use ApiX-Drive to independently integrate different services. 350+ ready integrations are available.
  • Automate the work of an online store or landing
  • Empower through integration
  • Don't spend money on programmers and integrators
  • Save time by automating routine tasks
Test the work of the service for free right now and start saving up to 30% of the time! Try it

The correct definition of CLS (for this, various techniques are used) will allow you to create pages that do not have such problems. Also, when creating a site, you must follow various recommendations to avoid unpleasant situations. For example, ensure that fonts are preloaded if they are non-standard.

CLS is fairly new and is part of Core Web Vitals. Since 2021, it has been one of the Google ranking factors. Perhaps not the most important, but it is still impossible to neglect it. A good indicator of CLS is considered to be up to 0.1. Indicators of 0.1-0.25 are acceptable, but require improvement, and above 0.25 this is already bad.

How to measure CLS?

CLS can be measured in several ways. It is quite convenient to look at the indicators in PageSpeed Insights .

PageSpeed Insights


And if this is your site, then take a look at the report in the Search Console .

Report in Search Console

How to improve CLS

To improve CLS and avoid unwanted layout shifts, do the following:

  • be sure to specify the width and height attributes for images and videos;
  • do not insert dynamic content on top of the main content without user interaction;
  • if there are advertisements on the site, reserve a static space for them.
***

Back Home eCommerce Encyclopedia

Set up integration without programmers – ApiX-Drive

Articles about marketing, automation and integrations on our Blog