Every time someone visits your website, their browser silently downloads a piece of JavaScript code called a tracking script. This is a small program that runs in the background, watches what the visitor does, which pages they view, where they came from, how long they stay and sends that information back to an analytics service like Google Analytics.
The visitor never sees it. They never click on it. But their browser downloads and executes it on every single page, every single visit.
Google Analytics loads roughly 45 KB of this tracking code onto every page of your website. Multiply that by your monthly traffic and the numbers stop being trivial.
This article breaks down the environmental cost of analytics tracking scripts, compares Google Analytics to the lightweight open-source alternatives that have emerged in recent years, and makes the case that switching is one of the easiest Green IT wins available to any website owner.
What your analytics script actually costs
Before we talk about the cost, it helps to understand what actually happens when a visitor lands on a page that runs Google Analytics.
When a visitor's browser loads your page, it encounters a <script> tag in your HTML that points to Google Tag Manager: a JavaScript file hosted on Google's servers at googletagmanager.com.
The browser downloads this file (~28 KB). Once executed, this script immediately fetches a second file: the Google Analytics tag from google-analytics.com (~17 KB).
Once both scripts are loaded and running, they begin collecting data:
- page URL
- referrer
- screen size
- browser
- device
- location
- scroll depth
- engagement time
…and more.
This data is then sent back to Google's servers as a series of HTTP requests. This happens on every page the visitor navigates to.
That’s roughly:
- 45 KB of JavaScript downloaded
- two external server connections
- tracking data sent back
for every page view.
Each of these steps has an energy cost.
The files must be:
- transferred over the network (routers, CDNs, cell towers)
- downloaded to the visitor's device
- parsed and executed by the browser
- followed by additional data sent back to external servers
All of this consumes electricity and computing resources.
Note
DNS lookup is how the browser translates a domain name (like googletagmanager.com) into an IP address it can connect to.
TCP connection is the handshake between the browser and the server that establishes a reliable communication channel.
TLS handshake is the encryption negotiation that happens for HTTPS connections.
Because Google Analytics uses two external domains:
googletagmanager.comgoogle-analytics.com
the browser performs the full:DNS → TCP → TLS
sequence twice, before a single byte of analytics data has even been collected.
For a site with 100,000 monthly page views, that's roughly 4.5 GB of analytics JavaScript transferred per month.
For a site with 1 million page views, it's 45 GB.
And that's just the tracking script.
It does not include the analytics data payloads sent back to Google's servers.
Note
These numbers assume the standard Google Tag Manager + GA4 integration, which is how most sites implement Google Analytics.
There are lighter implementations (minimal analytics scripts, self-hosted gtag), but the vast majority of websites use the default setup.
The lightweight alternatives
A new generation of analytics tools has appeared.
They share a common philosophy:
- collect only what you need
- use the smallest possible tracking script
- respect user privacy by design
Well-known ones include:
- Umami
- Plausible
- Fathom
- Cabin
- Simple Analytics
Several of these are fully open source.
What they have in common (from a Green IT perspective)
Script size
- Umami: < 2 KB
- Plausible: < 1 KB
- Cabin: ~1.2 KB
- Google Analytics (via GTM): ~45 KB
That’s roughly a 20× to 45× difference in JavaScript payload on every page view.
No third-party requests
Most lightweight alternatives either:
- self-host their script
- serve it from a single domain
Google Analytics requires connections to multiple Google-owned domains.
No cookies
These tools don’t use cookies, which means no cookie consent banners.
Consent banners themselves load additional:
- JavaScript
- CSS
- modal overlays
Removing the need for them reduces page weight further.
Smaller data payloads
Lightweight analytics collect fewer data points:
- page views
- referrers
- device type
- country
Google Analytics collects hundreds of data points, including:
- scroll depth
- engagement time
- user demographics
- session data
More data means more bytes sent back to servers.
Pro Tip
Plausible calculated that replacing Google Analytics on a site with 100,000 monthly visitors saves approximately:
- 7 GB of data transfer per month
- 84 GB per year
At an estimated 0.2 kWh per GB, that’s roughly:
16.8 kWh saved annually from a single script change.
The privacy argument
This article focuses on Green IT, but privacy is closely related.
Google Analytics:
- collects personal data
- uses cookies
- integrates with Google’s advertising ecosystem
This requires cookie consent banners under regulations such as:
- GDPR (EU)
- CCPA (California)
Lightweight alternatives:
- collect no personal data
- use no cookies
- require no consent banners
They are GDPR-compliant by design.
What Devly uses
Umami, self-hosted on a VPS at OVHcloud.
Umami is open source and OVHcloud has committed to powering its data centers with 100% renewable energy by 2025, with 77% already achieved.
They have also:
- signed a solar power purchase agreement with EDF Renewables
- implemented proprietary liquid cooling systems
- reported a PUE between 1.1 and 1.3
- signed the Climate Neutral Data Centre Pact
Self-hosting matters for Green IT.
When you self-host analytics:
- you control the infrastructure
- you choose the hosting provider
- you know where the data center is located
- you can verify its energy sourcing
Note
If self-hosting isn’t an option, good managed alternatives include:
- Plausible (open source, hosted on renewable-energy-powered Hetzner servers)
- Cabin (100% renewable hosting with built-in carbon tracking)
The counter-argument: when Google Analytics is justified
Google Analytics exists because it solves real problems.
For example:
- detailed conversion attribution
- e-commerce funnel analysis
- Google Ads integration
- advanced audience segmentation
- remarketing
Lightweight tools don’t fully replicate these capabilities.
But most websites don’t need them.
Typical sites like:
- blogs
- documentation sites
- portfolios
- small business websites
- SaaS marketing pages
mostly need:
- page views
- referrers
- top pages
- basic events
For these use cases, Google Analytics is dramatically over-engineered.
How to switch
Migrating is simpler than most people expect.
Typical process:
- Add the analytics
<script>tag to your<head> - Verify data appears in the dashboard
- Remove the Google Analytics script
- Remove the cookie consent banner (if analytics was the only reason)
Pro Tip
Before removing Google Analytics, export any historical data you want to keep.
Some tools, such as Plausible Analytics, offer a Google Analytics import feature that allows you to migrate historical statistics into their dashboard.
Analytics tracking scripts are only one piece of a website’s environmental footprint but they are a uniquely wasteful one because many sites load far more analytics infrastructure than they actually need.
For more: Devly digital
Top comments (0)