WebmasterID logoWebmasterID
Event tracking

Tracking Core Web Vitals as events

Core Web Vitals — Largest Contentful Paint, Interaction to Next Paint, and Cumulative Layout Shift — are field performance metrics you can record as analytics events. Google's open-source web-vitals JavaScript library measures them in real browsers and hands you a value and an id you can send as a custom GA4 event. This page covers what each metric means and how to model it as an event without any personal data.

Verified against primary sources

What this means

Core Web Vitals are a set of field performance metrics: Largest Contentful Paint (loading), Interaction to Next Paint (responsiveness, which replaced First Input Delay), and Cumulative Layout Shift (visual stability). Lab tools like Lighthouse estimate them, but field data from real visits is the ground truth — and that is what you can stream into analytics as events.

Modelling them as events

Google's web-vitals library exposes onLCP, onINP, and onCLS callbacks that fire with a metric object containing a name, value, rating, and a unique id. A common pattern is to send each as a GA4 event (often named after the metric) with the value and a non-identifying page path. The id lets you deduplicate a metric that updates during a session. Keep parameters generic: metric name, value, rating, path — nothing about the person.

How it appears in analytics and logs

A web-vitals event carries a metric name and value from a real session. High LCP or INP on a template means real users experience slowness that lab tests may miss.

Diagnostic use case

Send LCP, INP, and CLS from real visits as custom GA4 events so you can monitor field performance per page and device without identifying anyone.

What WebmasterID can help detect

WebmasterID can record performance signals as first-party events, so field Web Vitals sit alongside engagement data without cookies or cross-site identity.

Common mistakes

Privacy and accuracy notes

Web Vitals values are timings and layout-shift scores, not identities. Send the metric name, value, and a page path — never anything that identifies the visitor. This is educational, not legal advice.

Related pages

Sources and verification notes

Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.