Our tracking script is smaller than a favicon. How heavy is yours?

Your analytics script was probably the first thing you added to your site, and it's the last thing you'll ever check. Meanwhile it charges every visitor in bytes, blocked rendering and extra round trips. Here's how to see what yours costs in five minutes, and what the alternative looks like at 941 bytes.

Four ways a script slows a page

  • Bytes. They cost nothing on office fibre, and an eternity on one bar of signal in a train tunnel.
  • Blocking. A plain <script src> in the <head> stops the browser building the page until the script has downloaded and run.
  • Main-thread time. While a script runs, the page can't respond to taps. A tag manager plus a consent tool plus a session recorder can keep a mid-range phone busy for hundreds of milliseconds.
  • Extra round trips. A new domain means DNS, TCP and TLS before the first byte arrives. Then any request with custom headers triggers a CORS preflight: an OPTIONS request asking permission before the real one, which doubles the round trips for every event.
<script> async defer parsing paused interrupts parsing runs after parsing Parsing HTML Parsing HTML, resumed Parsing HTML Parsing HTML, resumed Parsing HTML, uninterrupted Downloading the script Downloading the script Downloading the script Running the script Running the script Running the script, after parsing Parsing HTML Downloading script Running script
A plain script tag pauses the page. defer lets the browser finish building it first.

Check yours in five minutes

Open your site in Chrome, open DevTools, go to the Network tab and reload.

  1. Filter by your analytics domain and add up the Transferred column, including any scripts it went and fetched on its own.
  2. Check the script tag for defer or async. Without either, it blocks your page.
  3. Look for OPTIONS requests. Each one is a preflight, and a wasted round trip.
  4. Run Lighthouse. "Reduce the impact of third-party code" lists every third party's size and main-thread time. It's remarkably candid.

Then do it again with throttling set to Slow 4G. That's much closer to what your visitors get than what you get at your desk, three feet from the router.

What 941 bytes looks like

When we built Foresite's tracking script, page weight was the one rule we wouldn't bend. Our customers run Webflow, Squarespace and WordPress sites, and plenty of them check Lighthouse the way other people check the weather.

  • 941 bytes gzipped, smaller than most favicons: about 120 lines of TypeScript with no dependencies.
  • Loaded with defer, so it never holds up rendering.
  • One request per pageview, with no preflight. A plain-text fetch body with no custom headers keeps it a CORS "simple request".
  • keepalive: true, so the event still gets sent when a visitor clicks away, without making them wait.
  • No entourage. No tag manager, no consent tool, and no cookie banner, because there are no cookies to ask about.

It's open source, and its tests run against the same minified bytes the server sends. Don't take our word for the numbers. Don't take anyone's.

Whatever you use, use defer

If you're keeping your current analytics, the cheapest speed-up available is adding defer to its tag. An async script runs the moment it arrives, which can interrupt the browser halfway through the page. A defer script waits until the page is built.

And if Lighthouse names your analytics among your heaviest third parties, ask what you're getting for all that weight. Pageviews, sources and conversions don't need much. The rest is features you may never open, and your visitors carry them on every page.