Post by account_disabled on Dec 2, 2023 23:06:40 GMT -5
How to calculate the CLS of a web page
Cumulative Layout Shift is measured with this formula:
layout shift score = impact fraction * distance fraction
Impact fraction measures the impact of unstable elements on the area of the window between two frames, see this image:
The element present in the image that occupies half of the viewport, this means that in the next frame, the element moves down by 25% of the height of the window.
The dashed red rectangle indicates the union of the visible area of the Country Email List element in both frames, which, in this case, is 75% of the total window, so its impact fraction is 0.75.
The distance fraction is the maximum distance that any “unstable” element is moved within the frame (horizontally or vertically).
In the example shown, the “unstable” element has moved 25% of the window height, which makes the distance fraction 0.25. So, in this example the impact fraction is 0.75 and the distance fraction is 0.25.
For a great user experience, Google recommends a CLS with a score lower than 0.1 .
Tools for measuring CLS
CLS can be measured with several tools, including:
Core Web Vitals chrome extension
All tools are valid and you can choose the one you prefer. In my opinion each one has something that differentiates it from the other, I often use more than one to get specific data.
For example, the convenience of the Semrush Site Audit is to have the overall calculation of all the pages and the percentage of the status:
This will save you a lot of time as with a single report and scan you will be able to see at a glance which pages have a low score and fix them.
Obviously, in addition to the CLS, all the Web Vitals parameters are measured.
How to improve your CLS score
We conclude with some practical advice to immediately improve
Cumulative Layout Shift is measured with this formula:
layout shift score = impact fraction * distance fraction
Impact fraction measures the impact of unstable elements on the area of the window between two frames, see this image:
The element present in the image that occupies half of the viewport, this means that in the next frame, the element moves down by 25% of the height of the window.
The dashed red rectangle indicates the union of the visible area of the Country Email List element in both frames, which, in this case, is 75% of the total window, so its impact fraction is 0.75.
The distance fraction is the maximum distance that any “unstable” element is moved within the frame (horizontally or vertically).
In the example shown, the “unstable” element has moved 25% of the window height, which makes the distance fraction 0.25. So, in this example the impact fraction is 0.75 and the distance fraction is 0.25.
For a great user experience, Google recommends a CLS with a score lower than 0.1 .
Tools for measuring CLS
CLS can be measured with several tools, including:
Core Web Vitals chrome extension
All tools are valid and you can choose the one you prefer. In my opinion each one has something that differentiates it from the other, I often use more than one to get specific data.
For example, the convenience of the Semrush Site Audit is to have the overall calculation of all the pages and the percentage of the status:
This will save you a lot of time as with a single report and scan you will be able to see at a glance which pages have a low score and fix them.
Obviously, in addition to the CLS, all the Web Vitals parameters are measured.
How to improve your CLS score
We conclude with some practical advice to immediately improve