Google Analytics: impact on page speed
Category: Analytics
Google Analytics 4 records page views and events through the gtag.js library. On its own it is moderately light; costs rise when it is loaded twice or when many custom events fire during page load.
On 11 % of the 5509 homepages measured, Google Analytics is among the five heaviest third parties. Where it is, it takes a median of 0 ms of main-thread time; on the heaviest quarter of those sites it takes 28 ms or more.
11 %
of homepages: among the five heaviest third parties
0 ms
median main-thread time
28 ms
main-thread time on the heaviest quarter (p75)
2 KB
median transfer size
Distribution across homepages
Percentiles across 619 homepages with Google Analytics.
| Percentile | Main-thread time | Transfer size |
|---|---|---|
| p25 |
0 ms
|
1 KB |
| Median |
0 ms
|
2 KB |
| p75 |
28 ms
|
23 KB |
| p90 |
46 ms
|
25 KB |
In context
By median main-thread time, Google Analytics ranks 70th of 72 third parties in the benchmark, lighter than Cloudflare and heavier than Google Fonts.
On 0.0 % of the homepages where it appears, Google Analytics alone uses 250 milliseconds of main-thread time or more, the mark from which Lighthouse flags third-party code.
Homepages with Google Analytics weigh 3.8 MB at the median (JavaScript: 1,008 KB), homepages without it 4.3 MB (JavaScript: 1.6 MB).
Often loaded together with
Share of homepages with Google Analytics where the other tool is also among the five heaviest third parties.
- Google Tag Manager 97 %
- Google Fonts 22 %
- Facebook 21 %
How to spot Google Analytics on your page
The gtag.js library loads from googletagmanager.com, which Lighthouse counts under Google Tag Manager; the measurement hits go to the collect endpoints on google-analytics.com and analytics.google.com. A common pattern on audited sites is Google Analytics loading twice, once hard-coded in the theme and once through Google Tag Manager, which doubles the script work without adding any data. If your figures show Google Analytics with an unusually high main-thread time, a duplicate installation is the first thing to rule out.
How to reduce the impact of Google Analytics
- Load Google Analytics through one path only: either gtag.js directly or Google Tag Manager, not both.
- Check for duplicate measurement IDs left over from migrations or plugins.
- Send non-essential events after user interaction instead of during page load.
Frequently asked questions
How can I load Google Analytics with less impact?
Load Google Analytics through one path only: either gtag.js directly or Google Tag Manager, not both. Check for duplicate measurement IDs left over from migrations or plugins.
Does Google Analytics affect Core Web Vitals?
Google Analytics mostly affects INP. The library itself is small, but event listeners and custom events that fire on clicks and scrolls add work to exactly the interactions INP measures. It does not change the layout and rarely delays LCP, unless it is loaded synchronously in the head ahead of the main content.
Method and sample: Third-Party Benchmark.