Consultancy · Loop Earplugs

Loop Earplugs: mobile INP about 800 ms faster, checkout conversion +7%

A Shopify store where every click on mobile waited for the template, the apps and the tags. Their developers fixed it, and I showed them where to look.

~800 msoff INP on mobile
+7%checkout conversion, their own figure
ClientLoop Earplugs
PlatformShopify
ServiceConsultancy, with training where it was needed
The client

Loop Earplugs, a Shopify theme with apps on top

Loop sells earplugs online. On mobile, adding to cart and opening the cart drawer took too long to show anything, on the way to the checkout.

Loop Earplugs homepage
What we found, what we did

Add to cart on mobile: theme code, apps, tags and the cart drawer

We read the INP traces together. The slow clicks were spread over the theme, the apps and the tags, and no single one of them was the cause. Their developers built the fixes; where they needed it, I trained them on reading the traces.

What was wrong
What we did
INP
Components in the theme did far more work on one click than the screen needed.
Their developers cut the work per click. The components update the screen first and do the rest afterwards.
INP
The theme's add-to-cart JavaScript and the cart drawer both ran in the same click, and the drawer rendered all of itself again.
The drawer renders only what changed.
INP
Apps on the page added their own work to the same clicks.
The apps that cost too much were removed or replaced.
Spring 2023

Nathan and I first talked in February 2023. INP on mobile was about a second, and 1,350 ms by March. We read the traces together, and the apps were in the clicks. ShopMessage went in March. Lucky Orange, a session recorder that listens to every click and scroll, went on 12 May with Builder.io’s tracking.

Beforehome page, 25 February 2023: 12 app scripts
pc-quiz.s3.us-east-2.amazonaws.com/…/quiz-loader.min.jsd38xvr37kwwhcm.cloudfront.net/…/grin-sdk.jscdn.shopmsg.me/…/shopmessage_platform.jsd275fvz7g8rvo.cloudfront.net/…/online_store_script.jslive-video-shopping-e4078.web.app/…/shows.jslive-video-shopping-e4078.web.app/…/integration.jsvision.duel.me/duel-analytics.jscdn.nfcube.com/97f451076844edac4b1d04779bdb9668.jsintg.snapchat.com/…/shopify-scevent-init.jsapp.backinstock.org/…/31939_1675166049.jscdn.builder.io/…/track.jstools.luckyorange.com/…/lo.js
After18 May 2023: 9
pc-quiz.s3.us-east-2.amazonaws.com/…/quiz-loader.min.jsd38xvr37kwwhcm.cloudfront.net/…/grin-sdk.jsd275fvz7g8rvo.cloudfront.net/…/online_store_script.jslive-video-shopping-e4078.web.app/…/shows.jslive-video-shopping-e4078.web.app/…/integration.jsvision.duel.me/duel-analytics.jscdn.nfcube.com/97f451076844edac4b1d04779bdb9668.jsintg.snapchat.com/…/shopify-scevent-init.jsapp.backinstock.org/…/31939_1675166049.js
The app scripts in Shopify’s load list on Loop’s home page, from the Internet Archive. Lucky Orange and Builder.io’s tracking left between 10 and 12 May 2023, ShopMessage in March.
November 2023

Then the theme. Every click on Add to cart asked Shopify to render three sections again, on the same click as the cart drawer. Their developers took those lines out on 20 November 2023, and by February 2024 the Klaviyo snippet that wrapped every fetch request was gone as well.

Beforeproduct-form.js
const formData = new FormData(this.form);if (this.dataset.cartType != 'page') {  formData.append('sections', this.cart.getSectionsToRender().map((section) => section.id));  formData.append('sections_url', window.location.pathname);  this.cart.setActiveElement(document.activeElement);}
Beforecart-notification.js, on the same click
renderContents(parsedState) {    this.cartItemKey = parsedState.key;    this.getSectionsToRender().forEach((section => {      document.getElementById(section.id).innerHTML =        this.getSectionInnerHTML(parsedState.sections[section.id], section.selector);    }));    if (this.header) this.header.reveal();    this.open();
From Loop’s theme, archived. Every click on Add to cart asked Shopify for three rendered sections, and cart-notification.js swapped each one into the page. The same week jQuery went too, and the home page dropped from 7 theme scripts to 5.
In CrUX

The spring is the big drop in CrUX: INP on mobile went from 1,350 ms in March 2023 to 475 in June, close to the 800 ms in Nathan’s quote. It crept back to 550 that autumn. After the theme fixes it was 375 by February 2024, and it stayed there. LCP fell too, from 4.3 seconds in September 2022 to 1.9 in October 2023.

200 ms500 msAug 2022Oct1450 msJan 20231350 msApr475 msJulOctJan 2024Apr375 msJulINP on mobile, p75
2.5 s4.0 sAug 20224.3 sOctJan 2023AprJul1.9 sOctJan 2024Apr2.2 sJulLCP on mobile, p75
loopearplugs.com in CrUX, phone, August 2022 to July 2024. One bar per month, p75, from Google’s CrUX data in BigQuery. Green is good, orange needs improvement, red is poor.
"Mobile got about 800ms faster and checkout conversion went up 7%. It paid for itself pretty much straight away."

Nathan Ziarczyk, Engineering Lead, Loop

What we learned

Every Shopify app adds a bit to every click

You install an app for one feature, and its script loads on pages and clicks that have nothing to do with that feature. On its own it costs a little. Stacked on a product page with the theme and the tags, it's part of the slow click.

INP is fixed in the template

App settings rarely change what runs in a click. The theme code decides that: what add to cart does, when the cart drawer renders, which app scripts load.

Faster clicks on the way to checkout pay off

I can't promise you 7%. That was Loop's own measurement, on their store.

Arjen Karel

Slow clicks on your Shopify store on mobile?

One to three days a week, sprint by sprint, working with your developers.

Loop Earplugs: Mobile INP 800 ms Faster, Checkout +7% Core Web Vitals Loop Earplugs: Mobile INP 800 ms Faster, Checkout +7%