Early accessCodeGecko is opening to a first group of teams.Join the waitlist

Core Web Vitals monitoring: how to set it up and what to watch

Checking PageSpeed Insights once isn’t monitoring. Here’s what to measure, five ways to monitor Core Web Vitals, how to do it yourself, and how to set up alerts that stay useful.

Nour9 min read ·
Every page, every release

Know before Google does.

Most teams check Core Web Vitals the same way: someone runs PageSpeed Insights before a launch, the numbers look fine, and nobody looks again until Search Console sends an email saying pages are failing. By then the release that caused it shipped weeks ago.

Monitoring fixes that. Instead of checking once, you measure all the time, on real visits, and you find out when a number moves. Here’s what to measure, the five ways to do it, and how to set up alerts that you won’t learn to ignore.

The short answer

Measure LCP, INP and CLS from your real visitors, take the 75th percentile, and split it by page and by device. Then compare each release with the one before it, and get an alert only when a page gets clearly worse. Search Console and PageSpeed Insights are free and worth checking, but their numbers cover the last 28 days, so they tell you about a problem weeks after it started.

A check tells you where you are. Monitoring tells you when something changed, and what changed it.

Why one check isn’t enough

Speed isn’t something you fix once. Every release can change it: a new dependency, a bigger hero image, a marketing tag added through a tag manager, a slower database query. None of these look like performance work, and most of them pass code review.

Speed also changes when you don’t ship anything. A third-party script updates itself, an ad partner starts serving heavier ads, or a campaign brings in visitors on slower phones. A check you ran last month says little about today.

And the numbers that count are your visitors’, not yours. Google ranks pages on real visits, not on a lab test, which is why a page can score green in Lighthouse and still fail. We explain that gap in Your Lighthouse score is green. Why are your Core Web Vitals failing?

What to watch

Good monitoring is less about collecting everything and more about looking at the right cut of the data. Five things matter:

  • The three Core Web Vitals. LCP (how fast the main content shows, good under 2.5s), INP (how fast the page reacts to a click or tap, good under 200ms) and CLS (how much the page jumps, good under 0.1). These are the ones Google uses.
  • The 75th percentile, not the average. Google judges each metric at the 75th percentile: the value three out of four visits beat. Averages hide the slow visits that people actually complain about.
  • Each page on its own. A site-wide number mixes your fast blog with your slow checkout. Group pages by template, like /products/:slug, so one slow product page doesn’t hide among a thousand fast ones.
  • Phones and desktops apart. Phones are slower and fail more often. Google scores them separately, so you should too.
  • Two helpers. TTFB (how fast the server answers) and FCP (when anything first shows) aren’t Core Web Vitals, but they tell you where a slow LCP comes from.

Five ways to monitor

There’s no single right tool. Most teams combine a free Google tool with one way of collecting their own data. Here’s what each option gives you.

  1. 01Search Console. Free, and it’s Google’s own verdict, so check it. The Core Web Vitals report groups similar pages and marks them Good, Needs improvement or Poor. The catch: groups are rough, small pages often show “not enough data”, and every number is a 28-day average, so it reacts slowly.
  2. 02PageSpeed Insights. Also free. The top of the report shows the same real-visit data for one page, the bottom runs a lab test. Good for a spot check of a single page, but it doesn’t keep a history or tell you when something changed.
  3. 03Scheduled lab tests. A robot loads a few pages every day or after each deploy, and you track the scores. It’s quick and steady, and good at catching big mistakes like a huge image. But a lab test doesn’t click, scroll or use real phones and networks, so it can’t measure INP and often misses layout shift.
  4. 04Your own script. Google’s free web-vitals library measures the three metrics in each visitor’s browser. You send the values to your analytics tool and build charts. It’s real data, but you have to build the percentiles, page grouping and alerts yourself.
  5. 05Release-based monitoring. A tool that collects real visits and groups them by release, so it can tell you whether the latest deploy made a page faster or slower. This is what CodeGecko does.

Doing it yourself

If you want to start with your own script, it takes less code than you might think. The web-vitals library gives you a function per metric, and each one calls you back with the value once the browser knows it.

  1. 01Add the library. Install web-vitals from npm and call onLCP, onINP and onCLS once when the page starts. Each one hands you the metric’s name and value.
  2. 02Send each value with context. Along with the number, send the page template, the device type and the version of your site that’s live. Without them, you can’t split the data later. Use navigator.sendBeacon so the value still arrives when the visitor closes the tab.
  3. 03Store it where you can query it. An analytics tool with custom events works for a start. For percentiles by page, device and version, a database or data warehouse is easier.
  4. 04Build the view. One table: each page template, phones and desktops apart, the 75th percentile of each metric for this week and the week before. That alone catches most problems.

The hard parts come later. Single-page apps need care, since a page change inside the app isn’t a new page load. Bots and preview tools pollute the data. Small pages don’t get enough visits for a steady number. And someone has to look at the table every week. That’s usually the point where teams switch to a tool.

When to get an alert

Alerts are where most monitoring setups fail. Set the threshold too low and you get an email every day because the numbers wobble. Set it too high and the alert comes after the damage. A few rules keep them useful:

  • Wait for enough visits. A 75th percentile from twelve visits is mostly luck. Wait for at least a few dozen measurements per page and device before you compare.
  • Ignore small moves. LCP going from 2.10s to 2.14s isn’t news. Only alert when the change is bigger than a few percent and bigger than a minimum per metric, like 100ms for LCP.
  • Compare like with like. Compare the same page on the same device. A drop in phone traffic can make the site-wide number look better when nothing changed.
  • Send it where the team already is. An alert in Slack or in the release thread gets read. A dashboard nobody opens doesn’t.

Tie it to your releases

The most useful question monitoring can answer is not “is the site fast?” but “did the last release make it slower?”. If you know which release moved a number, you know which commits to look at, and the fix is usually quick. If all you know is that LCP went up some time in the last month, you’re hunting through dozens of changes.

That’s why it helps to group your data by release instead of by day. A day mixes visits from before and after a deploy, while a release gives you a clean before and after. We explain the method in Did my deploy slow down my site? How to know for sure.

That’s what CodeGecko does. You add one script tag and connect GitHub, which takes about ten minutes. From then on it collects Core Web Vitals from real visits, groups them by release, and tells you after each deploy whether any page got faster or slower on phones or desktops, with the commits that shipped next to it. It only calls a change real once both releases have enough visits and the change is bigger than the normal wobble, and it can send the verdict to email or Slack. The docs have every rule, and the demo shows what a slower release looks like.

  • Measure LCP, INP and CLS from real visits, at the 75th percentile.
  • Split by page template and by device.
  • Keep checking Search Console, but don’t wait for it.
  • Compare each release with the one before it.
  • Alert only on clear changes with enough visits behind them.

Common questions

Is Search Console enough to monitor Core Web Vitals? It’s enough to know whether Google sees a problem. It isn’t enough to find what caused it, because every number covers the last 28 days and pages are grouped loosely.

Can I monitor Core Web Vitals with Google Analytics? Yes, by sending the values from the web-vitals library as custom events. You’ll need to work out percentiles and page grouping yourself, since analytics tools are built for counting visits, not for speed.

How often should I check? After every release, and once a week for slow drift from third-party scripts. A tool that compares releases does the first part for you.

Do I need lab tests if I have real-visit data? They help with different things. A lab test gives a quick, steady first look the moment you deploy. Real visits tell you what people actually got. We compare the two in Real user monitoring vs synthetic monitoring.

Does monitoring slow my site down? A good collector is a few kilobytes, loads after the page, and sends one small request per visit. It shouldn’t move your own numbers.

NourBuilding CodeGecko

Senior frontend engineer, night-shift gamer, weekend photographer, and the human who taught a gecko to watch your deploys.

Get in early.

We’re letting teams in a few at a time. Join the waitlist and we’ll email you once, when your spot opens.

Go deeper

Keep reading