PageSpeed Insights identifies that “storefront-banner.js” contains unused JavaScript. Shopify support says to contact Google and because due to security they cannot give access to the file. Both responses are unacceptable. This needs to be addressed as this is maliciously attacking shopify sites with no guidance how to either get shopify to load the entire file or to allow access to the file to be edited by a developer.
Topic summary
A user reports that PageSpeed Insights flags “storefront-banner.js” as containing unused JavaScript on their Shopify site. Shopify support declined to provide file access citing security reasons and suggested contacting Google instead—both responses deemed unhelpful.
Key Issue:
- No clear guidance exists on how to either optimize the file or prevent Shopify from loading it entirely
- The user views this as a malicious attack on Shopify sites that needs addressing
Expert Response:
PageSpeed Insights displays two data types:
- Core Web Vitals - Real visitor data
- Lab data - Synthetic testing environment (not real-world)
Recommendation:
If real user metrics show good performance (LCP under 2.5s, INP under 200ms, CLS under 0.10 for at least 75% of users), the lab-based warnings about storefront-banner.js can be disregarded. Real INP issues from this file have been observed, but primarily from users on low-end devices.
What’s interesting is that PageSpeed Insights isn;t dinging me aws much since I put in this complaint and talked with customer service
.
PageSpeed Insights shows two different sections:
- The Core Web Vitals section with data from your real visitors
- The LAB-based data generated in a syntenic environment (headless browser, 4x CPU slowdown, network throttle). This doesn’t represent real-world data but can give you some hits. If you have at least 75% of users with good LCP (under 2.5 seconds), good INP (under 200ms), and good CLS (under 0.10), then you don’t have to worry.
We’ve seen several INP issues from real users from interactions with the storefront-banner.js, but they come from users with low-end devices.
Thank you!
Dan