Search Console says your product pages fail INP. You run Lighthouse, the page looks fine, Total Blocking Time is modest, and you have no idea which interaction is slow for real users. This is the most common dead end in Core Web Vitals work, and it comes from debugging field problems with lab tools.
The fix is to collect attribution data from real users: not just "INP was 480 ms" but which element was clicked, which part of the interaction took the time, and which script was running. The web-vitals library does most of the work.
Field vs. lab in one paragraph
Google evaluates Core Web Vitals on field data from real Chrome users at the 75th percentile over 28 days. The thresholds for "good" are LCP of 2.5 s or less, INP of 200 ms or less and CLS of 0.1 or less. Lighthouse is a lab tool: one simulated load on one device profile, and no real interactions. It is excellent for diagnosing load performance and terrible at finding INP problems, because INP depends on what users actually click.
Collecting attribution
The attribution build of web-vitals (v5 at the time of writing) adds a diagnostic object to every metric:
import { onCLS, onINP, onLCP } from "web-vitals/attribution"; function report(metric) { const a = metric.attribution; const payload = { name: metric.name, value: Math.round(metric.name === "CLS" ? metric.value * 1000 : metric.value), rating: metric.rating, page: location.pathname, }; if (metric.name === "LCP") { Object.assign(payload, { target: a.target, url: a.url, ttfb: a.timeToFirstByte, loadDelay: a.resourceLoadDelay, loadDuration: a.resourceLoadDuration, renderDelay: a.elementRenderDelay, }); } if (metric.name === "INP") { Object.assign(payload, { target: a.interactionTarget, type: a.interactionType, inputDelay: a.inputDelay, processing: a.processingDuration, presentation: a.presentationDelay, loadState: a.loadState, script: a.longestScript?.entry?.sourceURL, }); } if (metric.name === "CLS") { Object.assign(payload, { target: a.largestShiftTarget, shift: a.largestShiftValue, loadState: a.loadState, }); } navigator.sendBeacon("/api/vitals", JSON.stringify(payload)); } onLCP(report); onINP(report); onCLS(report); Pick the fields explicitly instead of serializing the whole attribution object. It contains performance entries that are large and mostly useless once stringified. CLS is multiplied by 1,000 only to store it as an integer; divide again when you read it.
Send the data wherever you already collect analytics. A route handler that writes to a table is enough to start; what matters is that you can group by page template and target.
Reading LCP attribution
LCP splits into four parts, and the largest one tells you where to look:
- timeToFirstByte high: the server or CDN is slow. Caching, edge rendering or backend work.
- resourceLoadDelay high: the browser discovered the LCP image late. Typical causes are images set via CSS or JavaScript, or lazy-loading the hero image. A
fetchpriority="high"on the hero image and making it discoverable in the HTML usually fix this. - resourceLoadDuration high: the file itself is too big or too slow to download. Image size, format, CDN.
- elementRenderDelay high: the resource is there but rendering is blocked, often by render-blocking CSS or JavaScript, or by client-side rendering of the element.
target gives you a CSS selector for the LCP element. If it differs between users, for example a cookie banner on first visits, that is a finding in itself.
Reading INP attribution
INP splits into three parts:
- inputDelay: the main thread was busy when the user interacted. Long tasks from other scripts, often third-party tags or hydration.
loadStatetells you whether this happened while the page was still loading. - processingDuration: your event handlers are slow. The
targettells you which element;longestScriptpoints to the script that ran longest during the interaction. - presentationDelay: rendering the next frame took long. Large DOM updates, layout thrashing, expensive style recalculation.
In practice, INP problems cluster: one filter component, one menu, one "add to cart" button. Group by target and the worst offenders become obvious within a day of data.
Reading CLS attribution
largestShiftTarget names the element that moved the most. Common causes are images without dimensions, late-loading ads or embeds, web fonts swapping, and content injected above existing content. If loadState shows the shift happens after load, look at things triggered by user interaction or timers.
Closing the loop
Once you have a fix, verify it twice: in the lab immediately, where it applies, and in your own field data within days. The Search Console report will follow more slowly because of the 28-day window, so your own data is what tells you early whether the change worked.
Real-user data only covers pages with traffic. For a view across the whole site, it helps to run lab measurements on every page alongside a crawl. Crawl Foundry Site Audit measures crawled pages with Lighthouse on mobile and partly on desktop, keeping lab measurements, field data and crawl timing separate. See the Site Audit feature page, and the glossary entry on Core Web Vitals for thresholds and definitions.
