ClasesSEO
ES EN
SEO Search Engine Optimization

How to Measure Core Web Vitals With Your Own Users' Real Data (RUM)

8 min read Leer en español
How to Measure Core Web Vitals With Your Own Users' Real Data (RUM)
Table of contents

To measure Core Web Vitals from your own users you need three pieces, and none of them costs money: a 3 KB library, a place to send the data, and a query that returns the 75th percentile. The rest is knowing how to read the number instead of mistaking it for a lab score.

Measuring Core Web Vitals with your own data: the short answer

Google measures real users, but it shows you an aggregate of every Chrome user. If your site never reaches the minimum volume the Chrome UX Report requires, that aggregate simply does not exist and Search Console shows "No data available". That is where outside help ends: the only field data you have is the data you collect. If you want a refresher on what each metric captures, start with what Core Web Vitals are.

Building the instrument comes down to three decisions with no budget attached: measure with the official library, send the values to your own endpoint or to GA4, and read the 75th percentile by segment. A personal blog can ship it in an afternoon; a store with several templates needs about a week.

Why the Search Console report isn't enough

Credit where it is due: the Core Web Vitals report does show real field data, the 75th percentile over the last 28 days, split by device type and by groups of similar URLs. To learn whether the site passes or fails, it is the best first stop.

The three silences that cost you

The first is emptiness. If a URL group lacks a minimum amount of data for both LCP and CLS, Google's help is blunt: the URL is left out of the report. A new property, low traffic or a small section all produce the same screen. It does not mean you are fine; it means nobody is watching.

The second is sampling. Only indexed URLs appear, and data is assigned to the actual URL, not the canonical one. A template that lives across 4,000 addresses with parameters, filters and pagination shows up as a handful of scattered pages: the report describes a sample, not the template you designed.

The third is geography. Data is combined across all locations for all users. A market with slow connections drags the set down and hides the template that works perfectly in your country. For deciding what to fix, that is noise.

The three pieces you need (none of them paid)

Measure. The web-vitals library weighs around 3 KB compressed and measures the metrics in a way its documentation describes as matching how Chrome measures them. Read that carefully: it measures the same, it is not the browser's internal code. The distinction matters when you compare your numbers against CrUX.

Send. Two valid paths. The short one is GA4's gtag with the event from the official example. The long one, and the one that gives you control, is your own endpoint receiving JSON through sendBeacon: that method was designed to survive a tab closing, which is exactly when the final INP value arrives.

Read. You need distributions, and GA4 does not show them in its reports: it gives you averages and aggregates. The serious route is the BigQuery export, explained in Search Console to BigQuery, or a table of your own where you compute the percentile. Without that piece you have data, but no answer. And one clarification: lab data reproduces a problem and field data decides whether anyone cares; PageSpeed Insights shows both sides in a single panel.

The minimum code that works

No bundler, no build step. A module that imports the library from a CDN and sends each metric once it settles:

<script type="module">
  import {onLCP, onINP, onCLS} from 'https://cdn.jsdelivr.net/npm/web-vitals@6/dist/web-vitals.js';
  const send = ({name, value, delta, id, rating, navigationType}) => {
    const body = JSON.stringify({name, value, delta, id, rating, navigationType,
      page: location.pathname, vw: innerWidth});
    navigator.sendBeacon('/api/vitals', body);
  };
  onLCP(send); onINP(send); onCLS(send);
</script>

Four fields do the work. value is the accumulated value of the metric. delta is only what is new since the previous send, and it is what you add up when you store several records for the same load. id identifies the metric instance: use it to deduplicate and to group sends from one visit. rating already arrives classified as good, needs-improvement or poor, which saves you from repeating thresholds in the backend.

Two official details most people skip: the library uses the PerformanceObserver buffered flag, so it does not need to load before the rest of the code; and it should still be deferred, because it competes with whatever the user needs in the first milliseconds.

How to read the data: 75th percentile, not the average

The official rule in Web Vitals is to look at the 75th percentile of page loads, segmented across mobile and desktop. A page passes if it meets all three targets at that percentile: LCP of 2.5 seconds or less, INP of 200 milliseconds or less and CLS of 0.1 or less. It is not the average, not the best case and not the mean of your loyal users.

Averages mislead by design. With 100 visits, twenty-five slow users barely move the mean and yet sink the 75th percentile. The p75 answers a different question: what happens to the quarter of your users with the worst experience. Each metric has its own fix guide in LCP, CLS and INP.

Segment before you believe

A site-wide p75 across twenty templates cannot tell you which one to fix. Segment at least by template (home, article, product page, listing), by device, by country and by navigation type. That last one gets forgotten and it matters: a visit restored from history does not behave like a fresh load.

How much data you need before you trust it

There is no official magic number, and you should distrust anyone selling you one. The useful criterion is different: every segment needs enough samples that a single slow user cannot move the percentile. As a practical rule, do not draw conclusions below a hundred loads per segment; with thousands, you can drill down to specific templates and countries.

If traffic is high, measure everything and send between 10 and 20 %. The percentile does not change, the analytics volume does. What you cannot sample is your judgement: if you send one visit in ten, you need to know it. Watch seasonality too: CrUX's 28 days are a rolling window, so compare over that same window, not against deployment day.

Three traps that skew your RUM

bfcache and restores. When a user comes back with the back button, the page is restored and the library emits a new instance. If you add everything together, you count the same visit twice and your volume inflates on the pages with the most back-and-forth.

iframes. The library cannot see inside iframes, not even same-origin ones. If your page embeds content, the CLS you measure is the main page's without those shifts and it will not match CrUX, which does include them: what you measure is DCLS.

SPAs and soft navigations. In a single-page application, a route change is not a real navigation. Without soft-navigation events, all traffic lands on the first route and the others look perfect for lack of data, which is the worst way to be wrong: silently. And because of method and population, JavaScript-measured values can differ from CrUX; that is not a bug, they are two sources.

From data to decision: what to do with a red p75

With the segmented table, the order of attack becomes obvious: the template with the most traffic and the worst percentile first, and inside it the guilty element. The library's attribution data tells you which element was the LCP, which interaction ran long and which block pushed the layout, turning a hypothesis into a task list.

To measure the effect, repeat the reading with the same segment and the same 28-day window, or run an A/B test as described in A/B testing and SEO. And do not cross this line when writing the report: Core Web Vitals are part of the page experience signals that ranking systems seek to reward, not a ranking switch. The guaranteed benefit is for the user, less waiting and fewer jumps, and the SEO follows from that.

An 8-point checklist to ship your RUM today

  • Library installed and deferred, not blocking first render.
  • Sending through sendBeacon to an endpoint that tolerates bursts.
  • value, delta and id stored, not just the final number.
  • 75th percentile computed in the query, never the mean.
  • Segmentation by template, device, country and navigation type.
  • Sampling defined and documented if volume is high.
  • bfcache, iframes and soft navigations handled in the data model.
  • Before-and-after comparison with the same window and the same segment.

If you cannot measure your users, you are only guessing with a lab score. And a score is not a diagnosis.

We use cookies to improve your experience and analyze site traffic. By continuing to browse you accept their use.

Privacy