What is CLS and Why is it Important?

0

Cumulative Layout Shift measures the total amount of layout shifts that occur on a web page as it loads and is interacted with. 

Google measures CLS in order to judge the overall page experience alongside the other two core web vitals, First Input Delay (FID) and Largest Contentful Paint (LCP).

Having multiple content shifts on one page will add up to a worse CLS score. An ideal page experience is a page with minimal CLS.

A layout shift, or content shift, is any time something on the page visibly changes position within the frame.

This can be anything from text font changing, images loading slowly, and pop-ups that shift the page around as it loads.

Here’s an example of what a poor amount of CLS looks like

In Summer 2021, Google confirmed that the three core web vitals are now part of the Page Experience ranking factor. 

So it’s important to make sure that your pages’ core web vitals all fall within the following ranges that Google deems “good.”
 

 

Good

Needs improvement

Poor

LCP

<=2.5s

<=4s

>4s

FID

<=100ms

<=300ms

>300ms

CLS

<=0.1

<=0.25

>0.25

If your vitals measure in the needs improvement or poor range, your rankings could suffer and it’s recommended that you address the issue.

How to Check Cumulative Layout Shift

There are many ways to check your page’s Cumulative Layout Shift CLS. You can use Google’s tools like Lighthouse or the Core Web Vitals report in Google Search Console, or you could check on Semrush using Site Audit. 

Defining Good or Poor CLS

Google officially defines CLS scores into the following ranges:

  • Good CLS: Below 0.10
  • Needs improvement CLS: Between 0.10 and 0.25
  • Poor CLS: Above 0.25

What Causes Poor CLS?

As stated above, layout shifts can be caused by a lot of things. The most common culprits are:

  • Images without dimensions 
  • Ads, embeds and iFrames without dimensions
  • Dynamically injected content 
  • Web fonts causing FOIT/FOUT (flash of invisible text and flash of unstyled text)
eNjC9IasrVB4HKemq3mCaJvaYl-YLQSh4CkIn1L5JxkJq3gKseDOA3quT62G8fzPTH6a9ukVXyWuFVhzBcZyzhfGAldRoED2kmHsu64r4aVsdhZHOHl2wAQWSIqpmsPq1yCrGmX6

All of these causes live in your page’s code and can be identified in only a few minutes of inspection.

For images and embeds without dimensions, simply identifying those images and then adding the known dimensions to your code will help avoid layout shifts. If you don’t know 

How to Fix and Avoid Layout Shifts

To fix your cumulative layout shifts, you first need to identify the elements causing the shifts. 

Then, your developer can take a number of actions to address the issue and optimize the page speed. 

img-semblog

Lighthouse has some recommendations that could help you and/or your development team to deal with shifts, such as:

How to Inspect Shifts 

To optimize the CLS, you need to understand what is causing shifts. 

There are two ways to see the exact shifts:

  • Using special recommendation in Performance Audit of Lighthouse called “Avoid large layout shifts “
  • Using trace

In both variants, it will be easy if you launch a Performance audit via Lighthouse. 

To open Lighthouse, right-click anywhere on the webpage and select Inspect.
 

l7zgIScUGcN0w1xGc5cF2YZ8Nf-BARHxANcG7JtZcsV1YkxxvaQh0l_vkBFzCvn-1unR4YWj61zOTl0g8svdJ33OG8b4EhqnamdOFEZJtW6A1R8BOEwRkUMSt-Au7qnwLbofp60V

Avoid Large Layout Shifts

Find and open the recommendation “Avoid large layout shifts.” It’s available in the Lighthouse Performance audit if there was at least one task shift during loading. Just scroll down to find it.

CSH2Jg66Jf1X14KN-P4qY2MnjEkyvpmwdotcurQ5X9zBTaZXeANVUA3k-IgnmsTp_lZgpMQs8GewJJdDCP7_jXxSvzG7elOOYsgZK8tlFxXhd0j6lArRuDu4dCIBMucPn99waV6B

If you expand the item you can check each element’s “CLS Contribution.”
 

BnQgYJGJX0gYbi4FxQ4ys0L8vXC9jRAkL_Y_SGt8d3L9s5iPLsYRwmwswO5n3uXSsRX62YJGaLYS3ZUoF5T5wCURdUCFcs_i364tOCbpmxTdWTrN3O8sZ2rfVryyHeW8kUAJMwsQ

Don’t worry if you see an element with a CLS contribution of 0.001, for example, because it wouldn’t really hurt the user experience. 

We know that Google marks pages that have anything up to 0.010 shifts in total as “good” pages.

Viewing Original Trace

To find out what part of a page made shifts in a timeline, you can view the original trace in Lighthouse.

First, click on click View Original Trace in the Lighthouse report. This will open the Performance tab.

FOsRMvK5MiuvOYYVLcsVPUWK8e1hmvgBxG2u3kjWbeWpKy6a6E2RfqeR9tw2kuAjo9_w00EfmbKW1q8COEZwgiWoleHi_OxqGystAIGd3J2XAqtAowtuIfnFY36hY8WNrgWVk0zs

Look through the Experience track or the Web Vitals track to find when those shifts happened. 

Zoom in and look for Layout shifts (LS) to see what part of the page made these shifts during loading.

zHqJ_mw6wOOcplil7cS53cBz6MIRgwv-b6jbn-Lea3ifdKo-e4swIwRr6M5VUkFb4ZbgJ2cvUxixhVfjeuFBgeOB9icqZfGDaLrsAZcFpR5-UIXkRNQvzdZCiB_DKCbdAxjr4Tio

Measuring CLS in Semrush

Semrush’s Site Audit allows you to track cumulative layout shifts, along with the other core web vitals when you audit your website. 

The great benefit of using Semrush here is that it will save your historical data in the special Core Web Vitals report. 

This allows you to first inspect your core web vitals, then make changes, and then re-run the audit and see how your scores improved. 

vK05R2ke3L8qasOKen70Fv5IQ4eonh_MfVOASpGyGOo5TMm-kcdoFei4Ylg31q1y3mo3Xn_ZQTafWtDST2RFiGZ6mGsXSS9ImLItMBu8GMRchOkAreeqOhdv6WjIOb20mB7stw3n

You’ll also find a whole Performance report with more information about how to improve the overall page load speed of your website, along with other optimization tips.

Try it out today and get your page experience optimized! 

FOLLOW US ON GOOGLE NEWS

 

Read original article here

Denial of responsibility! Search Engine Codex is an automatic aggregator of the all world’s media. In each content, the hyperlink to the primary source is specified. All trademarks belong to their rightful owners, all materials to their authors. If you are the owner of the content and do not want us to publish your materials, please contact us by email – [email protected]. The content will be deleted within 24 hours.

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More