Why Analytics Script Size Matters (And Which Tools Are Lightest)
Every kilobyte counts. The analytics script you load on every page of your site has a direct impact on load times, Core Web Vitals, and search rankings. Here's how to pick the lightest option without sacrificing insights.
At a Glance
- Google Analytics 4 loads 45.7 KB of JavaScript — the heaviest mainstream analytics script by far.
- Plausible and Copper Analytics both ship scripts under 1 KB, making them the lightest options available.
- Heavy analytics scripts block rendering, inflate bandwidth usage, and drag down Core Web Vitals scores.
- Loading strategy matters almost as much as file size —
async,defer, and framework-level strategies all play a role. - Lighter scripts directly improve LCP, reduce Total Blocking Time, and can boost your PageSpeed score by 5–15 points.
Jump to section
Why Analytics Script Size Matters
Every website that uses analytics loads a JavaScript file on every single page view. For a site with 100,000 monthly visitors, that script executes 100,000 times. If your analytics script is 45 KB instead of 1 KB, you're asking your visitors to collectively download an extra 4.4 GB of JavaScript every month — just so you can count pageviews.
The size of your analytics script matters because it directly affects three things your users and search engines care about: how fast your page appears on screen, how responsive it feels during interaction, and how much mobile data it consumes. In a web where Google uses Core Web Vitals as a ranking signal, a bloated analytics script is not just a performance problem — it's an SEO problem.
The good news is that modern privacy-first analytics tools have proven you can capture meaningful visitor data with scripts measured in bytes, not kilobytes. The question isn't whether lightweight alternatives exist — it's why anyone still tolerates the heavy ones.
How Analytics Scripts Affect Page Loading
To understand why script size matters, you need to understand what happens when a browser encounters a <script> tag. The browser must download, parse, compile, and execute the JavaScript before it can continue rendering the page. Even with modern optimizations, this process has real costs.
Render Blocking
By default, a <script> tag in the <head> is render-blocking. The browser stops parsing HTML, downloads the script, executes it, and only then resumes rendering. Google Analytics 4's default installation uses a pattern that initiates script loading early in the page lifecycle, which means its 45.7 KB payload directly competes with your critical rendering path.
Bandwidth Cost
On a fast broadband connection, 45 KB downloads in milliseconds. On a 3G mobile connection — still common in many markets — that same 45 KB takes 300–500 ms to arrive. A sub-1 KB script arrives in under 10 ms on the same connection. For mobile-heavy audiences, this difference is significant.
Main Thread Work
After downloading, the browser must parse and execute the script. Larger scripts mean more main-thread work, which increases Total Blocking Time (TBT) and can delay Interaction to Next Paint (INP). GA4's script doesn't just track pageviews — it initializes session management, event queuing, consent mode checks, and debug utilities. All of that code runs on your visitor's device.
Watch Out
Many analytics tools load additional secondary scripts after the initial payload. GA4's gtag.js loads the main library, which then fetches a configuration payload and may load additional modules. The 45.7 KB figure represents just the primary script — total cost can be higher.
Analytics Script Size Comparison
We measured the gzipped transfer size of each tool's primary analytics script. These are the files your visitors download on every page load:
| Tool | Script Size (gzip) | Cookies Required | 3G Load Time (est.) |
|---|---|---|---|
| Google Analytics 4 | 45.7 KB | Yes (multiple) | ~400 ms |
| Matomo (cloud) | 22.8 KB | Optional | ~200 ms |
| Fathom | 1.5 KB | No | ~15 ms |
| Plausible | <1 KB | No | ~8 ms |
| Copper Analytics | <1 KB | No | ~8 ms |
The difference is staggering. GA4's script is 45 times larger than Plausible's or Copper Analytics's. Matomo sits in the middle at 22.8 KB — lighter than GA4 but still 22 times heavier than the sub-1 KB options. Fathom lands at 1.5 KB, which is still remarkably lean.
Methodology Note
Sizes represent the primary tracking script as measured by gzipped transfer size in Chrome DevTools. GA4 and Matomo may load additional secondary resources after the initial script, increasing total payload further. Measurements taken March 2026.
Impact on Core Web Vitals and Page Speed Scores
Google's Core Web Vitals — LCP, INP, and CLS — are the metrics that determine whether your site passes the “page experience” ranking signal. Analytics scripts affect two of the three directly.
Largest Contentful Paint (LCP)
LCP measures how long it takes for the largest visible element to render. A heavy analytics script competes for bandwidth and main-thread time during the critical loading phase. In our tests, removing GA4 from a mid-complexity marketing site improved LCP by 120–180 ms on simulated 4G connections. Replacing it with a sub-1 KB alternative recovered nearly all of that improvement while retaining analytics functionality.
Interaction to Next Paint (INP)
INP measures responsiveness. Every millisecond your analytics script occupies the main thread is a millisecond where user interactions are delayed. GA4's initialization routine takes 20–40 ms of main-thread time on a modern device. On budget Android phones, that can stretch to 80–120 ms. A sub-1 KB script completes initialization in under 2 ms.
PageSpeed Insights Scores
Lighthouse and PageSpeed Insights penalize render-blocking resources and excessive JavaScript. In controlled tests against the same static site, we observed:
- No analytics: PageSpeed score 100
- With Copper Analytics (<1 KB): PageSpeed score 99–100
- With Plausible (<1 KB): PageSpeed score 99–100
- With Fathom (1.5 KB): PageSpeed score 98–100
- With Matomo (22.8 KB): PageSpeed score 93–96
- With GA4 (45.7 KB): PageSpeed score 85–92
The sub-1 KB scripts are effectively invisible to Lighthouse. GA4 can cost you 8–15 points on the performance score, which is the difference between a “green” and “orange” rating for many sites. For more on measuring these metrics, see our guide to website speed analysis tools.
Loading Strategies: async, defer, and afterInteractive
How you load your analytics script matters almost as much as its size. The right loading strategy can mitigate the performance cost of heavier scripts — though it can never fully eliminate it.
The async Attribute
Adding async to a script tag tells the browser to download the script in parallel with HTML parsing and execute it as soon as it arrives. This prevents the script from blocking the initial parse, but execution still interrupts the main thread. GA4's recommended installation uses async by default. The download happens in parallel, but the 45 KB of JavaScript still has to be parsed and executed, which briefly blocks rendering.
The defer Attribute
The defer attribute downloads the script in parallel and delays execution until after the HTML document has been fully parsed. This is better for performance than async because it guarantees the script won't interrupt the initial render. For analytics scripts that don't need to run before the page is visible, defer is almost always the better choice.
Next.js afterInteractive Strategy
If you're using Next.js, the next/script component provides a strategy="afterInteractive" option that loads the script after the page becomes interactive. This is equivalent to defer but integrated into the framework's hydration lifecycle. For a sub-1 KB script, the strategy barely matters — the script is so small that even synchronous loading has negligible impact. For GA4, using afterInteractive is essential to avoid degrading your initial load experience.
Web Worker Offloading
Tools like Partytown attempt to move third-party scripts (including analytics) into a Web Worker, freeing the main thread entirely. While promising in theory, this approach adds complexity and can break scripts that need DOM access or rely on specific browser APIs. The simplest path to main-thread freedom is to choose a script that barely uses the main thread in the first place.
Pro Tip
If your analytics script is under 1 KB, the loading strategy is nearly irrelevant — the performance impact is negligible regardless. Save your optimization energy for scripts that actually need it. The best optimization is shipping less JavaScript in the first place.
Real-World Performance Tests
Theory is useful, but data settles debates. We tested five analytics tools on the same static marketing page (Next.js 15, hosted on Vercel) using WebPageTest with a simulated Moto G Power on 4G LTE. Each test was run five times and averaged.
Test Results
- Baseline (no analytics): LCP 1.2s, TBT 45 ms, PageSpeed 100
- Copper Analytics (<1 KB): LCP 1.2s, TBT 46 ms, PageSpeed 100 — no measurable impact
- Plausible (<1 KB): LCP 1.2s, TBT 47 ms, PageSpeed 99 — no measurable impact
- Fathom (1.5 KB): LCP 1.2s, TBT 48 ms, PageSpeed 99 — negligible impact
- Matomo (22.8 KB): LCP 1.4s, TBT 78 ms, PageSpeed 94 — noticeable impact
- GA4 (45.7 KB): LCP 1.6s, TBT 112 ms, PageSpeed 88 — significant impact
The sub-1 KB scripts added zero perceivable delay. Fathom at 1.5 KB was similarly invisible. Matomo added 200 ms to LCP and nearly doubled TBT. GA4 added 400 ms to LCP and increased TBT by 150%, pushing the site from a perfect score into “needs improvement” territory.
These results become even more dramatic on slower connections. On simulated 3G, GA4 added over 800 ms to LCP, while the sub-1 KB scripts remained within 10 ms of the baseline.
Lighter Scripts Mean Better SEO
Since 2021, Google has used Core Web Vitals as a ranking signal. While content quality remains the dominant factor, page experience is a tiebreaker — and in competitive SERPs, tiebreakers matter. Here's how a lightweight analytics script contributes to better search rankings:
- Better LCP scores: Pages that load faster pass Google's “good” LCP threshold (under 2.5 seconds) more consistently. Every millisecond saved by a lighter script pushes you further into the safe zone.
- Lower TBT and better INP: Reduced main-thread work means your page responds to interactions faster. Google's INP threshold is 200 ms — a heavy analytics script can consume a significant chunk of that budget on slower devices.
- No cookie consent friction: Privacy-first tools that skip cookies eliminate the need for consent banners, which often add their own JavaScript weight and degrade CLS by shifting content as they appear.
- Crawl budget efficiency: While Googlebot doesn't execute all JavaScript, lighter pages are crawled more efficiently. Every unnecessary byte in your page adds friction to the crawling and indexing process.
The connection between performance and rankings is not theoretical. Sites that pass all three Core Web Vitals thresholds see measurably higher click-through rates in search results, partly because Google surfaces a “fast page” indicator in mobile search and partly because faster sites have lower bounce rates.
For a deeper look at monitoring these vitals without relying on Google's own analytics, read our guide to monitoring Web Vitals without Google Analytics.
Ready to Shed the Weight?
Copper Analytics delivers full analytics, AI crawler tracking, and Core Web Vitals monitoring in a script under 1 KB. Zero cookies. Zero consent banners.
Try Copper Analytics FreeChoosing the Lightest Analytics Tool
If script size is a priority — and for performance-conscious teams, it should be — here's how the five tools stack up as overall choices:
- Google Analytics 4 (45.7 KB): The industry default, but the heaviest option by a wide margin. GA4 is justified only when you need its advanced attribution modeling, BigQuery integration, or deep Google Ads connectivity. For most websites, it's overkill and the performance cost is real.
- Matomo (22.8 KB): A solid open-source choice with self-hosting options and GDPR compliance. At 22.8 KB, it's roughly half the weight of GA4, but still 22 times heavier than the lightest alternatives. Best for teams that need GA-style features without sending data to Google.
- Fathom (1.5 KB): Extremely lightweight with a clean dashboard and strong privacy credentials. At 1.5 KB, it's effectively invisible to performance tools. A great choice if you value simplicity and are willing to pay from day one (no free tier).
- Plausible (<1 KB): One of the two lightest analytics scripts available. Open source, EU-hosted, and self-hostable. Excellent for teams that want transparency and minimal overhead. No free tier on the managed service, but self-hosting is free.
- Copper Analytics (<1 KB): Tied for the lightest script available. Goes beyond basic pageview tracking with AI crawler detection and built-in Core Web Vitals monitoring. Includes a free tier that neither Plausible nor Fathom offers on their managed services.
Bottom Line
If you want the lightest possible analytics with the most features, Copper Analytics gives you sub-1 KB tracking, AI crawler visibility, and Web Vitals monitoring — with a free tier to start. No other tool matches that combination at that weight.
Final Thoughts
The analytics script you choose is one of the few third-party resources that loads on every single page of your website. Its impact compounds across every visitor, every session, and every page transition. A 45 KB script that seems harmless on a fast connection becomes a measurable drag on mobile performance, Core Web Vitals, and ultimately search rankings.
The privacy-first analytics movement has proven that meaningful website analytics don't require heavyweight JavaScript. Plausible, Fathom, and Copper Analytics deliver the metrics most teams actually use — pageviews, visitors, referrers, top pages, device breakdowns — in scripts that are 30 to 45 times smaller than GA4.
If performance matters to you, switch to a lightweight analytics tool. It's one of the highest-impact, lowest-effort changes you can make to improve your site's speed. And if you want a tool that's light and tracks what traditional analytics miss — AI crawlers and Core Web Vitals — give Copper Analytics a try. It's free to start.
Try Copper Analytics Free
The lightest analytics script with the most features. AI crawler tracking, Core Web Vitals, and privacy-first analytics — all in under 1 KB. No cookies. No consent banners.
Get Started Free