The moment every store goes slow
You’ve just launched a new Hyvä store. On the test environment it scored a perfect 100 on PageSpeed Insights. Then the tag manager goes live. Marketing adds a conversion tracker, a visitor-behaviour tool, a chat widget, a review badge and a YouTube video, and with every tag the score slides further down.
At the Hyvä Meetup I talked about exactly that moment: what third-party scripts really cost, and how to keep a store fast without telling marketing “no”.
Why it matters
Speed is not a vanity metric. A one-second delay in mobile load times can cut conversion rates by up to 20%, and back in 2006 Amazon found that every 100 ms of extra load time cost them 1% in sales. A slow experience drives customers away; a fast one helps you win and keep them.
A perfect PageSpeed score is a good starting point, not the goal. The real story is in the waterfall: open DevTools or WebPageTest and look at what loads, in which order, and what blocks the page.
Start with the low-hanging fruit
Before optimising anything, remove what you don’t need:
- Leftovers — scripts in the tag manager that belonged to the old site.
- Dead subscriptions — scripts for services nobody pays for anymore.
- Nice-to-haves — scripts that do something, just nothing that matters to the business.
- Platform features — native browser APIs, like the Web Share API, that replace a whole library.
Then swap the heavy scripts you keep for lighter ones. Lite YouTube Embed renders a video roughly 224× faster than the default embed, and Minimal Analytics 4 sends Google Analytics 4 events with about 2 kB of JavaScript.
Get out of the critical path
- Don’t block rendering. A third-party stylesheet or a synchronous script in the
<head>holds the whole page hostage. Load scripts withasyncordefer. - Warm up the connections you need. Fonts from Adobe Typekit are a classic chain: a stylesheet that imports another stylesheet that finally requests the font.
preconnectto those origins andpreloadthe font file, and the chain collapses. - Host third-party scripts yourself. Serving a copy from your own domain turns a third-party request into a first-party one. Scripts that change a lot can be refreshed nightly. Google Fonts is the best-known example (even if it isn’t a script).
Load on user interaction
The biggest win: don’t load the tag manager — or any heavy script — while the page loads. Load it the moment the visitor first interacts: touchstart, mouseover, wheel, scroll or keydown.
Hyvä has this pattern built in. It dispatches an init-external-scripts event once, on the first interaction. Listen for it and push an event into the data layer:
window.addEventListener('init-external-scripts', () => {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({ event: 'user_interaction' });
}, { once: true, passive: true });
In Google Tag Manager, create a Custom Event trigger for user_interaction and fire the heavy tags on it instead of on page view. The first paint stays clean; the tags still load before anyone can click “buy”.
The same trick works for other widgets. Load review badges like Trusted Shops on interaction, and load chat widgets — often 500 kB to 1 MB of React — only when someone clicks a lightweight, fake chat button.
Going further
- Partytown (still in beta) moves third-party scripts into a web worker, off the main thread, so your own code gets the CPU.
- Server-side Google Tag Manager. Browser-based tracking and cookies are on borrowed time; server-side tracking is where this is heading, and it turns third-party scripts into first-party requests. But it only covers tracking, analytics and marketing tags, some tools still need client-side JavaScript, it can get expensive (especially when done wrong) and it gets very technical, very fast.
Takeaway
A fast store is not a one-off optimisation. It’s a series of deliberate choices about what you load, when you load it and how. That’s what keeps a Hyvä store as fast in production as it was on the test environment.













































