Cooee is built so that adding it to your store has near-zero effect on how fast your pages load. This article explains the specific engineering choices behind that, the requests Cooee makes to your store, and how to check whether a slowdown comes from Cooee or from somewhere else.
How Cooee is built for performance
1. Non-blocking script loading
Cooee's SDK is added to the page as a module script with the browser's async flag. Module scripts never block HTML parsing — the browser continues building and painting your page while Cooee is fetched in the background.
In practice this means Cooee cannot delay your content appearing. It is not in the critical path for rendering, and nothing about your page waits on it.
2. Code is added only when it is needed
Cooee does not ship one fixed payload to every page. Most of what it can inject sits behind a condition, so a page that does not need a feature never downloads the code for it.
Experiments are the clearest example. The experiment runtime is only added when your store actually has a live experiment:
{%- assign activeExperiments = app.metafields.letscooee.activeExperiments -%}
{%- if activeExperiments and activeExperiments.value.size > 0 -%}
<script id="cooee-experiments">...</script>
{%- render 'experiment-runtime' -%}
{%- endif -%}With no experiment running, that block renders nothing at all — not a deferred script, not an empty tag. Zero bytes reach the browser. The same pattern governs page context: the product snippet renders only on product templates, the cart snippet only on cart templates, and so on.
3. Heavier features load in separate files, only when a page needs them
The core SDK is kept small. The heavier parts of Cooee are split into separate files that the browser fetches only when something on the page needs them:
Widgets file (sticky add-to-cart, progress bar, savings bar, shoppable video, collection filter, product options picker): fetched only on pages where a widget is displayed. A page with no live widget never downloads it.
Popup renderer: fetched only when a popup is actually triggered for the visitor.
Carousel library: fetched only when a carousel is shown.
Error reporting: fetched only when it is needed, never as part of the first load.
The practical effect is that a page with no live campaign downloads only the small core SDK, and the cost of Cooee on a page grows with what you run on that page.
4. Minified and mangled JavaScript
Everything Cooee ships is compiled and minified before it reaches your store. Comments and whitespace are stripped, and every internal name is shortened to a character or two. Our source is written to be readable by our engineers; what your visitors download is optimised purely for size.
Here is a real example. This is how we write it:
export function showAntiFlicker(): void {
if (document.getElementById(STYLE_ID)) return;
const style = document.createElement('style');
style.id = STYLE_ID;
style.textContent = 'body{opacity:0!important;pointer-events:none!important}';
document.head.appendChild(style);
_timeout = setTimeout(removeAntiFlicker, TIMEOUT_MS);
}And this is the same function as it actually ships — one line, every name shortened:
var b="lc_anti_flicker",J=1500,x=null;function W(){if(document.getElementById(b))return;const e=document.createElement("style");e.id=b,e.textContent="body{opacity:0!important;pointer-events:none!important}",document.head.appendChild(e),x=setTimeout(T,J)}The function name becomes W, the constants become b and J, comments are gone, and separate statements are merged. Across the theme runtime, roughly 39 KB of source compiles down to about 12 KB of JavaScript.
5. CDN delivery and long-lived caching
Nothing Cooee serves comes from a single origin server. Two separate CDNs are involved:
SDK JavaScript and CSS are published to jsDelivr, which is itself backed by Cloudflare's global network — one of the fastest and most widely distributed in the world. Your visitors get the SDK from an edge node near them.
Widget configuration and campaign data are served via Amazon CloudFront. API responses are delivered from the edge location nearest each visitor, keeping latency low regardless of where your customers are.
Every SDK file has a version in its URL and is served with a one-year immutable cache header. After a visitor's first page, every later page on your store loads these files from the browser cache, with no network request at all. If you measure with "Disable cache" switched on in DevTools, you are seeing the first visit only.
6. Viewport-aware video playback
Videos inside Cooee widgets only begin playing once they scroll into the visitor's viewport, so off-screen video never consumes bandwidth or competes with your page for resources while it is loading.
7. No media hosted by Cooee
Cooee does not host product images, collection images, videos or GIFs on its own servers. Those assets are served from your store's files or Shopify's CDN — the approach Shopify recommends — so they benefit from the same caching as the rest of your storefront. Because these are your files, their size is in your hands: a large image uploaded into a widget slows that widget exactly as it would anywhere else on your page, so compress images before uploading them.
Requests Cooee makes to your store
Besides its own CDN, Cooee calls a few of your store's standard Shopify endpoints. Each has a specific purpose:
Cart read (
/cart.js): used to show cart-based campaigns, such as a bar that appears only when the cart has items. It is skipped when your theme already provides the cart to Cooee, and on market storefronts it uses the locale path (for example/en-us/cart.js), as Shopify recommends.Storefront API reads (
/api/…/graphql.json): used to show live prices and stock for products inside a campaign. They run only on pages where a campaign shows products, and results are cached for the rest of that page view.Cart attributes: Cooee adds its visitor and session reference to the cart so that orders can be attributed to the campaigns that influenced them. This is written once per session, after the page has loaded or when the cart changes, and only when the cart has items. Other apps' cart attributes are left untouched.
You may see a ?from=cooee tag on some of these requests. Since SDK version 14.15.1 this tag is added only when Cooee's debug mode is switched on, so normal visitor sessions don't carry it.
Many other apps (checkout, payment, upsell and analytics apps) and most themes call the same endpoints. Before attributing a /cart.js or graphql.json request to Cooee, check the Initiator column in your browser's Network tab, which shows the script that made it.
Layout shift
In-page widgets are placed where you choose in the campaign and take their height once they have rendered. Above-the-fold placements are the most likely to move content, so place large widgets lower on the page where you can.
To judge layout shift, use field data from real visitors rather than a single test run: Shopify's Web Performance report in your admin shows Cumulative Layout Shift at the 75th percentile, and Google considers anything under 0.1 "Good".
Redirect experiments: a deliberate exception
Theme, split-URL and template experiments decide a visitor's variant in the page <head> before anything renders, then redirect if needed. To stop visitors seeing a flash of the original page first, Cooee briefly masks the page while that decision is made and clears the mask the moment the variant is settled, with a short safety timeout as a backstop.
This is a deliberate trade-off: a brief, controlled pause in exchange for a clean experience with no content flicker. It applies only to stores running a redirect experiment, and only to pages within that experiment's scope. Stores with no live redirect experiment are unaffected.
Checking whether a slowdown comes from Cooee
A Shopify store usually runs many apps and scripts at once, so it helps to compare them the same way. These are the checks we run ourselves when a store reports a slowdown:
Compare every app the same way. In Chrome DevTools, open the Network tab, reload the page, and group the requests by the script or app that loaded them. App embeds load from paths like
/extensions/…/<app-name>/. Include Cooee in the comparison.Check the Initiator column for any request you are unsure about, to see which script started it.
Look for prefetches. Requests marked with the
Sec-Purpose: prefetchheader and Lowest priority are downloaded in the background for a page the visitor might open next. They don't slow the current page, but they do count in the "transferred" total.Check uploaded images and theme CSS. Very large images in widgets, and theme CSS rules with
!importantthat target Cooee's classes (.lc-container,.lc-textand so on), are common causes of slow or broken widgets.Look for unused app embeds and duplicate libraries. An app embed that is still switched on keeps loading its scripts even if you no longer use the app, and themes and apps often load the same library (jQuery, carousels, icon fonts) more than once.
If you've done these checks and still think Cooee is involved, contact us with the page URL and what you saw, and we'll investigate it with you.
What we measure
We validate real-world impact with Google PageSpeed Insights, comparing a store before and after the SDK is enabled. Across the core metrics we see near-zero impact:
First Contentful Paint — near zero impact
Largest Contentful Paint — near zero impact
Time to Interactive — near zero impact
Total Blocking Time — near zero impact
Speed Index — near zero impact
