Optimizing CLS by 0.2 led to a 15% increase in page views per session, 13% longer session durations, and a 1.72 percentage point decrease in bounce rate.


![Tomoki Kiraku](https://web.dev/images/authors/gladenjoy.jpg) Tomoki Kiraku [X](https://twitter.com/gladenjoy) ![Milica Mihajlija](https://web.dev/images/authors/mihajlija.jpg) Milica Mihajlija [X](https://twitter.com/bibydigital) [GitHub](https://github.com/mihajlija) [Homepage](https://mihajlija.github.io/) ![Shunya Shishido](https://web.dev/images/authors/sisidovski.jpg) Shunya Shishido [X](https://twitter.com/sisidovski) [GitHub](https://github.com/sisidovski) [Homepage](https://sisidov.ski/)

<br />

[Yahoo! JAPAN](https://www.yahoo.co.jp) is one of the largest media companies in Japan,
providing over 79 billion page views per month. Their news platform, [Yahoo!
JAPAN News](https://news.yahoo.co.jp) has more than 22 billion page views per
month and an engineering team dedicated to improving the user experience.

By continuously monitoring Core Web Vitals, they correlated the site's
improved [Cumulative Layout Shift (CLS)](https://web.dev/articles/cls.md.txt) score with a 15%
increase in page views per session and 13% increase in session duration.
0.2

CLS improvement
15.1~%~

More page views per session
13.3~%~

Longer session duration

> [!NOTE]
> **Note:** [Cumulative Layout Shift](https://web.dev/articles/cls.md.txt) measures how visually stable a website is---it helps quantify how often users experience unexpected layout shifts.

Page content moving around unexpectedly often causes accidental clicks,
disorientation on the page, and ultimately user frustration. Frustrated users
tend not to stick around for long. To keep users happy, the page layout should
stay stable through the entire lifecycle of the user journey. For Yahoo! JAPAN
News this improvement had a significant positive impact on business critical
engagement metrics.

For technical details on how they improved the CLS, read the
[Yahoo! JAPAN News engineering team's post](https://techblog.yahoo.co.jp/entry/2021022230076263/).

## Identifying the issue

Monitoring Core Web Vitals, including CLS, is crucial in catching issues and
identifying where they're coming from. At Yahoo! JAPAN News, [Search
Console](https://search.google.com/search-console/about) provided a great
overview of groups of pages with performance issues and
[Lighthouse](https://developer.chrome.com/docs/lighthouse) helped identify per-page
opportunities to improve page experience. Using these tools, they discovered
that the article detail page had poor CLS.
![Google Search Console Core Web Vitals Report showing high CLS for article details page.](https://web.dev/static/case-studies/yahoo-japan-news/image/google-search-console-cor-65713bd9c58c3.png) Google Search Console Core Web Vitals Report. ![Lighthouse Avoid large layout shifts audit showing DOm elements that contribute the most to the CLS on the page.](https://web.dev/static/case-studies/yahoo-japan-news/image/lighthouse-avoid-large-la-23c5555fd5f8f.png) Lighthouse "Avoid large layout shifts" audit shows which elements are contributing to CLS score and how much.

It's important to keep in mind the *cumulative* part of the Cumulative Layout
Shift---the score is captured through the entire page lifecycle. In the
real-world, the score can include shifts that happen as a result of user
interactions such as scrolling a page or tapping a button. To collect CLS scores
from the [field
data](https://web.dev/articles/how-to-measure-speed#lab_data_vs_field_data), the team
integrated [web-vitals](https://github.com/GoogleChrome/web-vitals/) JavaScript
library reporting.

> [!NOTE]
> **Note:** As a part of performance monitoring strategy, they're also working on building an internal tool with [Lighthouse CI](https://web.dev/articles/lighthouse-ci.md.txt) to continuously audit performance across businesses in the company.

The team used Chrome DevTools to identify which elements were making layout
shifts on the page.
[Layout Shift Regions](https://developer.chrome.com/blog/new-in-devtools-77)
in DevTools visualizes elements that contribute to CLS by highlighting them with
a blue rectangle whenever a layout shift happens.
![Article details page with blue rectangles overlaid on the hero image and the text.](https://web.dev/static/case-studies/yahoo-japan-news/image/article-details-page-blu-565ff494e023.png) Visualized layout shifts.

They figured out that a layout shift occurred after the hero image at the top of
the article was loaded for the first view.
![Screenshots of the article details page showing side by side comparison before and after layout shift.](https://web.dev/static/case-studies/yahoo-japan-news/image/screenshots-the-article-b6de7e5cb4ab7.jpg) Layout shift on the article detail page.

In the example above, when the image finishes loading, the text gets pushed down
(the position change is indicated with the red line).

## Improving CLS for images

For fixed-size images, layout shifts can be prevented by specifying the `width`
and `height` attributes in the `img` element and using the CSS
[`aspect-ratio`](https://web.dev/articles/aspect-ratio.md.txt)
property available in modern browsers. However, Yahoo! JAPAN News needed to
support not only modern browsers, but also browsers installed in relatively old
operating systems such as iOS 9.

They used [Aspect Ratio Boxes](https://css-tricks.com/aspect-ratio-boxes/)---a
method which uses markup to reserve the space on the page before the image is
loaded. This method requires knowing the aspect ratio of the image in advance,
which they were able to get from the backend API.
![Screenshots of the article details page showing side by side comparison before and after CLS optimization.](https://web.dev/static/case-studies/yahoo-japan-news/image/screenshots-the-article-5191c90be0709.jpg) Left: reserved blank space for the image at the top of the page; right: the hero image loaded in the reserved space without layout shifts.

## Results

The number of URLs with poor performance in Search Console decreased by 98% and
CLS in lab data decreased from about 0.2 to 0. More importantly, there were
several
[correlated improvements in business metrics](https://nicj.net/cumulative-layout-shift-in-the-real-world/).
![Search Console report showing a significant drop in pages with performance issues.](https://web.dev/static/case-studies/yahoo-japan-news/image/search-console-report-sho-a2a53f06e3baf.png) Search Console after improvements.

> [!NOTE]
> **Note:** Search Console doesn't reflect improvements in real-time.

When Yahoo! JAPAN News compared user engagement metrics before and after CLS
optimization, they saw multiple improvements:
15.1~%~

More page views per session
13.3~%~

Longer session duration
1.72~%\*~

Lower bounce rate (\*percentage points)

By improving CLS and other Core Web Vitals metrics, Yahoo! JAPAN News also got
the
["Fast page" label](https://blog.chromium.org/2020/08/highlighting-great-user-experiences-on.html)
in the context menu of Chrome Android.
![Fast page label in Chrome on Android.](https://web.dev/static/case-studies/yahoo-japan-news/image/fast-page-label-chrome-da3bd8521a851.png) "Fast page" label in Chrome on Android.

Layout shifts are frustrating and discourage users from reading more pages, but
that can be improved by using the appropriate tools, identifying issues, and
applying best practices. Improving CLS is a chance to improve your business.

For more information, read the
[Yahoo! JAPAN engineering team's post](https://techblog.yahoo.co.jp/entry/2021022230076263/).