
TL;DR: Exploring Core Web Vitals for Shopify stores
- Largest Contentful Paint (LCP) measures loading speed.
- Interaction To Next Paint (INP) measures website interactivity.
- Cumulative Layout Shift (CLS) measures visual stability.
- Shopify Analytics
- Google Search Console
- PageSpeed Insights
- Lighthouse
- For LCP enhancement, optimize image formats, enable lazy-loading for everything except the main LCP asset, and prioritize fetching this asset.
- To improve INP, check your thread for long-running tasks to optimize them, minimize apps, and delay non-critical scripts.
- To optimize CLS, reserve space for images and dynamic content that appear over time, and avoid apps that inject content on top of the loaded pages.
What are Core Web Vitals?
Core Web Vitals metrics

- Largest Contentful Paint (LCP) measures loading performance. It shows how quickly the main content of a web page loads. Why is it important for user experience? Once a user sees the content, they can evaluate if the webpage is useful and make a decision about their next actions. From the technical point of view, LCP reports the time for the largest image, text, or video to become visible. A good LCP is 2.5 seconds or less.

- Interaction To Next Paint (INP) measures page interactivity or its overall responsiveness. It shows the level of latency for interactions across the webpage, such as clicks, taps, and text events. Why does it matter? If a user is stuck at some point, unable to open a tab, this may ruin the UX. For most websites, an interaction with the longest latency is reported as INP. A good INP is 200 milliseconds or less.
- Cumulative Layout Shift (CLS) measures webpage visual stability. It shows if unexpected movements of page elements occur. Why does it matter? From the user's end, such shifts may occur when some elements, such as ads or images, are added to the page before the existing content, making user actions problematic. Technically, CLS measures the largest burst in layout shift scores during the page lifecycle. A good CLS is 0.1 or less.
How to track Core Web Vitals for your Shopify stores?

- In your website's Google Search Console, go to Experience → Core Web Vitals to see statistics over time for desktop and mobile.

- PageSpeed Insights is a Google service that lets you check Shopify Core Web Vitals and additional metrics, such as First Contentful Paint (FCP) and Time to First Byte (TTFB), for a specific URL.

- Lighthouse is a developer tool that helps monitor store performance. It's available in Chrome DevTools and as a Chrome extension.

Techniques to improve the Core Web Vitals score on a Shopify store
Tips for improving Largest Contentful Paint (LCP) for a Shopify store

- Optimize image formats. Shopify now supports AVIF, which is even smaller than WebP. Use the image_tag Liquid filter to let Shopify automatically serve the best format.
- Disable lazy-loading for the first element. The LCP element is typically your hero image or the first product image. If it's waiting for a user scroll to be loaded, this will spike your LCP. So, your first section's image should have the loading= eager tag to not damage LCP.
- Enable lazy loading for everything else. Your pages load faster if the elements that follow a hero banner are loaded as users scroll them down. Shopify pre-built themes typically ensure lazy loading automatically using loading= lazy for sections further down the page. Still, check if it's true for your theme.
- Prioritize fetch. Use the attribute fetchpriority=high on your LCP image to tell the browser this is the most important asset on the page.
How to improve Interaction to Next Paint (INP) for a Shopify store

- Check the thread for long-running tasks. If some task runs longer than 50-100 ms, it could be a signal to rewrite its logic by splitting it into smaller chunks so as not to block other processes. For instance, long tasks, such as complex filters, may delay the execution of the 'Add to cart' click. The click won't register until the task is finished.
- Run app audit. Every app adds JavaScript, which is a heavy load to the main thread. Uninstall any app you aren't using regularly. Check your theme.liquid for 'ghost code' left behind by uninstalled apps. To replace necessary but heavy apps, use Shopify's native features or custom high-quality code.
- Delay non-critical scripts. Use the defer or async attributes for third-party scripts, such as heatmaps and chat widgets, to move them down the page so they don't stop the critical elements from being interactive.
Tips to optimize Cumulative Layout Shift (CLS) for a Shopify store

- Set image dimensions. Define width and height in your img tags. This tells the browser to reserve that space even before the image downloads.
- Reserve space for dynamic content. If you have an announcement bar or a 'Product recommendations' section that pops in late, use CSS to set a min-height so the rest of the page doesn't get pushed down when it appears.
- Avoid content injections. Don't use apps that inject banners or pop-ups at the top of the page after it has loaded. Move these to the bottom or use a fixed-height container.
The bottom line
- Get insights about your current Core Web Vitals scores using tools such as PageSpeed Insights and Lighthouse.
- Check how CWV on Shopify has changed since the last known period, which metric has moved, and which device has issues.
- Choose pages that have the most impact first, such as the homepage and collections.
- Run the page analysis on both desktop and mobile and document any issues.
- To improve LCP, set high priority for the main content to be shown first on a page, enable lazy-loading for the rest of the content, and set optimal image formats.
- For better INP, optimize your theme by reducing the number of apps, deferring scripts, and editing long-running tasks.
- To optimize CLS, reserve space for images and dynamic content that pop up late and avoid using apps that add elements on top of the loaded pages.
















































Was this helpful?
0
No comments yet