Webcarbon

Latest News

Step by step method to measure website CO2 per page view

Why measure CO2 per page view

Measuring emissions per page view turns abstract sustainability goals into actionable engineering metrics. It lets product teams compare page variants, assess the impact of third party tools, and build carbon budgets that map directly to user traffic. The method below emphasizes repeatability and transparent assumptions so numbers can be audited or recalculated as inputs change.

Overview of the measurement model

At a page view level most measurable emissions arise from three buckets. First, network transfer between client and servers. Second, server side compute and storage work needed to serve the page. Third, device energy consumed while rendering and displaying the page. Each bucket requires two steps to convert to CO2. The first step converts activity to energy in kilowatt hours. The second step multiplies energy by a grid emissions intensity in grams or kilograms of CO2 equivalent per kilowatt hour.

Minimum viable estimate

If you need a quick, auditable number you can combine page transferred bytes with an accepted network energy intensity and add a small server energy allowance. This will not capture device CPU work precisely but it gives a repeatable baseline that is easy to measure and useful for comparisons.

Data you must collect

Collect the following for each page you want to measure. Use automated tooling when possible.

  1. Transferred bytes per page view measured after caching and compression. Use WebPageTest or browser devtools for lab tests and Resource Timing or server logs for real user data.
  2. Server work per request expressed as CPU seconds or energy per request. Prefer measurements from the origin or application host. If unavailable, use estimates from typical request CPU profiles for your stack.
  3. Data center ancillary losses expressed as power usage effectiveness or PUE. Obtain PUE from your hosting provider or use a conservative default if unknown.
  4. Grid emissions intensity in gCO2e per kWh for the region where energy is consumed. Use ElectricityMap for real time or national datasets like IEA or eGRID for audited averages.
  5. Network and device energy factors if you will model beyond transfer size. These can come from LCA literature or measured power models for representative devices and networks.

Step by step measurement process

Step 1 Measure transferred bytes per page view

Run a set of representative page loads. For lab measurements use WebPageTest or Lighthouse to capture fully loaded transfer size and resource level breakdown. For real user monitoring capture total bytes using Resource Timing and the Navigation timing APIs combined with response header size fields when available. Store the distribution of bytes per page view rather than a single mean to preserve variance for reporting.

Step 2 Convert bytes to network energy

Choose an energy intensity for network transfer expressed in kWh per gigabyte or kWh per byte. Sources vary. For conservative reporting show results using a low, medium and high intensity from published studies or industry datasets. Multiply transferred bytes by the chosen intensity to get kWh for the network portion.

Step 3 Measure or estimate server energy per request

If you control the backend, measure average CPU time consumed per request either at the process level or via application profiling. Multiply CPU time by the host CPU power draw to obtain watt seconds then convert to kWh. Adjust for server utilization and multi tenancy if your hosts serve many workloads. If you use managed hosting and cannot measure CPU seconds, request per request energy estimates from the provider or use a documented proxy number. Apply the facility PUE to account for cooling and infrastructure losses.

Step 4 Model device energy if needed

Device energy can matter for heavy client side apps or long viewing sessions. Options range from a default multiplier based on rendering work to a detailed power model. For detailed modeling measure CPU time in the browser via Performance API and estimate energy using device specific power coefficients when available. For comparisons where device work is small relative to network, document the omission and show sensitivity analysis.

Step 5 Convert kWh to CO2 using local grid intensity

For each kWh consumed determine the appropriate emissions factor. If the energy was consumed in a cloud region use that region’s intensity. For client side energy use the local grid intensity where the user is located if you have geolocation for the page view. When location is unavailable use a conservative global average and report the assumption. Multiply total kWh by the emissions factor to get grams or kilograms of CO2 equivalent per page view.

Step 6 Aggregate and report distributions

Report the mean CO2 per page view and at least one measure of spread such as the median and the 90th percentile. Provide the inputs used for conversion factors and include a sensitivity table that shows how results change when you vary network intensity, PUE, and grid factors. This delivers transparency and allows readers to re-run calculations with updated inputs.

Practical implementation patterns

Fast route for product teams

Collect transferred bytes per page view using a small real user monitoring snippet that records total transferred bytes and the page path. Process samples server side to compute averages and combine with a single chosen network energy intensity and a single hosting energy allowance. Use this route to track trends and assess experiments. Always publish the assumptions and ranges.

Reproducible research route

For audits and public claims build a pipeline that captures resource level transfer sizes, origin CPU seconds, client geolocation and user device class. Persist raw samples for a rolling period. Use a reproducible script to apply energy intensities and grid factors so numbers can be recalculated later when conversion factors are updated.

Example calculation with labeled assumptions

Below is an illustrative example. The numbers are hypothetical and serve only to demonstrate the formulas.

  1. Transferred bytes per page view 1.2 megabytes.
  2. Chosen network intensity 0.0001 kWh per megabyte.
  3. Network energy 1.2 megabytes times 0.0001 gives 0.00012 kWh.
  4. Measured server CPU work converts to 0.00005 kWh per request. After applying a PUE of 1.2 server side energy becomes 0.00006 kWh.
  5. Total energy per page view 0.00018 kWh. If the chosen grid intensity is 400 grams CO2e per kWh then emissions equal 0.072 grams CO2e per page view.

Show these numbers with your own inputs and with at least two alternative network intensities and grid factors to make the range explicit.

Common pitfalls and how to avoid them

Mixing lab and real user numbers without adjustment. Lab tools often run from a single region and a single device type. When you combine lab transfer sizes with real world grid intensities you must ensure the geographic mapping of energy consumption is consistent.

Using a single conversion factor as a universal truth. Energy intensities for networks and grids vary by country and over time. Publish the value, the source, and the date.

Overfitting to a single page snapshot. Page weight fluctuates by user, A B test, and cache state. Use distributions and time windows that match reporting needs.

Communicating results responsibly

Always present the assumptions up front. Provide the raw inputs and a simple spreadsheet or script that reproduces the math. When you publish CO2 per page view for external audiences include uncertainty bounds and a short note on scope clarifying what is included and what is omitted.

Suggested disclosure items

List the date ranges of measurement, the measurement method lab or RUM, the network intensity values used and their sources, the grid emissions factors and their sources, whether device energy was modeled and how, and the PUE applied to server energy.

When to use page view metrics and when not to

Use CO2 per page view for feature comparisons, A B tests, and continuous monitoring of regressions. Avoid using it as the sole metric when evaluating business level impacts that involve user behavior changes. For end to end product decisions combine per page estimates with traffic forecasts to get total impacts and consider rebound effects such as additional user sessions caused by faster pages.

Next steps and operational checklist

Decide which measurement route fits your team. For quick wins deploy a RUM byte counter and calculate per page CO2 using a published network intensity and a single hosting allowance. For audit ready reporting build the reproducible pipeline that stores raw samples and applies region specific grid factors. In all cases document assumptions, publish the conversion script, and refresh conversion factors on a regular cadence.

Leave a Reply

Your email address will not be published. Required fields are marked *

Leave a Reply

Your email address will not be published. Required fields are marked *