How to optimize Shopify apps (ScriptTag API). Code + demo

Shopify Partner
1547 44 346


I've bumped my head many times trying to optimize stores with many apps. Finally, I've written some code that allows optimizing these types of apps.


Quick demo:

Optimized product (291Kb JS initial load)

Unoptimized product (679Kb JS initial load)


On both pages, there are 5 apps loaded via ScriptTag API. On the optimized page, the apps are loaded only on user interaction (user page scroll and interaction).  

This little "trick" bumps Lighthouse points from ~48 to ~69 (will vary based on the device you test on).


The code is available at

You can read more technical details and how to set up the section on my blog:


Happy optimization!

Finally—Add variant descriptions to your products
Replies 0 (0)