Feedback

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 46 % of the 41458 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 0 ms or more.

46 %

of homepages: among the five heaviest third parties

0 ms

median main-thread time

0 ms

main-thread time on the heaviest quarter (p75)

1 KB

median transfer size

Distribution across homepages

Percentiles across 19148 homepages with Google Analytics.

Percentile Main-thread time Transfer size
p25
0 ms
1 KB
Median
0 ms
1 KB
p75
0 ms
4 KB
p90
29 ms
23 KB

In context

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.

On a typical homepage Google Analytics makes up 0.0 % of the page weight.

Often loaded together with

Share of homepages with Google Analytics where the other tool is also among the five heaviest third parties.

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 long Google Analytics blocks the main thread on your own page is shown by the Total Blocking Time test.

How to reduce the impact of Google Analytics

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.

Run a free test Create a free account All third parties in the benchmark