every script on your site should earn its place

Your site loads code from companies you forgot you signed up with. Each script costs your visitors bytes, battery and privacy on every page view, whether it does anything useful that day or not. This rant is about the pile of third-party scripts on most sites, how it gets there, and a five-question test to decide which ones stay.
open the network tab
Go on. Load your homepage with DevTools open and filter by third-party domains.
A typical pile looks like this. Two analytics tools, because the second one had a nicer dashboard. A heatmap you looked at once during a redesign. An A/B testing script from an experiment that ended in spring. An ad pixel for a campaign you paused. Fonts from someone else’s CDN. A chat widget that boots a whole app before anyone asks anything. And a cookie banner, loaded to ask permission for all of the above.
None of these was a bad decision on the day it was made. Together, they’re the reason your page feels slow on a phone.
what each one costs
Bytes and time. Every script is downloaded, parsed and run, often on the main thread, while your visitor is trying to scroll.
Privacy. Every third-party request tells another company that this visitor was on this page. You didn’t mean to share that. The script did it for you.
Consent. More scripts that set cookies or track people means a longer, uglier banner, and a legal question you now have to answer for each of them.
Security. A third-party script runs with the same power as your own code. If that company gets breached, your checkout page runs whatever the attacker ships.
Attention. Each tool comes with a dashboard, a login and a monthly invoice. Some of those invoices you haven’t looked at in a year.
how the pile grows
Nobody decides to have eleven third-party scripts. It happens one “just add this snippet” at a time.
Marketing wants attribution. Someone wants to see where people click. A plugin adds its own tracking because the plugin author wanted analytics too. And lately, agents: you told yours to “add analytics”, and it helpfully added three.
Removing scripts never feels urgent, so nobody does it. The pile only goes one way.
the five-question test
Go through every script on the list and ask:
- Who added it, and do they still work here? If nobody owns it, it goes.
- When did someone last look at what it collects? If the answer is “the week we added it”, it goes.
- Does it load on pages where it’s never used? A booking widget on the blog, a chat app on every page for the one visitor who clicks. Move it to where it’s needed.
- Could it wait for an interaction? A lot of scripts only matter once someone clicks something. Load a tiny placeholder and fetch the rest on the click.
- Does it send data somewhere you’d be uncomfortable explaining to a visitor? Then either explain it or drop it.
A script that passes all five has earned its place. Most sites keep far fewer than they expect.
we failed this too
We’re not preaching from a clean desk. Our own Polish and Turkish homepages scored 93 on a mobile Lighthouse run, while most of our pages scored 99, because we shipped font files full of letters none of our 12 languages use. They were our own files, on our own domain, and they were still dead weight. We cut them down to the letters we actually need, and a test now fails if a translation brings in a letter outside that set. Today the site scores 100.
what we did with ours
Spookat is a third-party script on your site, so this rant applies to us first.
The launcher is under 4 kb gzipped, and the build fails if it grows past that. It makes 0 requests to our API before a visitor clicks. It sets no cookies. The panel, its fonts and the connection to our server only load when someone clicks the launcher, which is question 4 of the test, built in. We never store an IP address, so the requests we do get after a click don’t turn into a profile of your visitors.
Our lab measured what chat widgets load before anyone clicks: the weight, the Lighthouse cost and the cookies, with the method and raw data published. Go look at what your current one does.
the short version
Every script on your page should pay rent. Most of them are squatting.
Open the network tab this week and evict one. Then read what we load and when.