Core Web Vitals
Understand the performance metrics tracked by Pipetrace.
Pipetrace automatically captures Core Web Vitals for every page view. These metrics are sent with the page_exit event and help you understand real-world performance from your users.
Google's Core Web Vitals (2024)
These are the three metrics Google uses for search ranking:
Loading
≤ 2.5s
Interactivity
≤ 200ms
Visual Stability
≤ 0.1
All Performance Metrics
web_vitals_lcpMeasures loading performance. LCP marks the point when the largest content element becomes visible.
- • Optimize and compress images
- • Use a CDN for static assets
- • Preload critical resources
- • Remove render-blocking JavaScript
web_vitals_inpMeasures responsiveness. INP tracks the latency of all interactions throughout the page lifecycle.
- • Break up long JavaScript tasks
- • Minimize main thread work
- • Use web workers for heavy computation
- • Optimize event handlers
web_vitals_clsMeasures visual stability. CLS tracks unexpected layout shifts during the page lifecycle.
- • Always include size attributes on images
- • Reserve space for ads and embeds
- • Avoid inserting content above existing content
- • Use CSS transform for animations
web_vitals_fcpMeasures initial render time. FCP marks when the first content is painted to the screen.
- • Reduce server response time
- • Eliminate render-blocking resources
- • Minify CSS and remove unused CSS
- • Preconnect to required origins
web_vitals_ttfbMeasures server responsiveness. TTFB tracks the time from request to first byte received.
- • Use a CDN to reduce latency
- • Optimize server-side code
- • Use HTTP/2 or HTTP/3
- • Cache dynamic content when possible
web_vitals_fidLegacy metric (replaced by INP). FID measures the delay from first interaction to browser response.
- • Note: FID is being replaced by INP as of March 2024
- • Focus on optimizing INP instead
Quick Reference
| Metric | Field Name | Good | Needs Work | Poor |
|---|---|---|---|---|
| LCP | web_vitals_lcp | ≤ 2,500ms | ≤ 4,000ms | > 4,000ms |
| INP | web_vitals_inp | ≤ 200ms | ≤ 500ms | > 500ms |
| CLS | web_vitals_cls | ≤ 0.1 | ≤ 0.25 | > 0.25 |
| FCP | web_vitals_fcp | ≤ 1,800ms | ≤ 3,000ms | > 3,000ms |
| TTFB | web_vitals_ttfb | ≤ 800ms | ≤ 1,800ms | > 1,800ms |
| FIDLegacy | web_vitals_fid | ≤ 100ms | ≤ 300ms | > 300ms |
Debugging Web Vitals
You can access current Web Vitals values using the JavaScript API:
// Get current Web Vitals
pipetrace.getWebVitals();
// Returns:
{
lcp: 1234, // Largest Contentful Paint (ms)
fid: 12, // First Input Delay (ms)
inp: 89, // Interaction to Next Paint (ms)
cls: 0.05, // Cumulative Layout Shift
fcp: 890, // First Contentful Paint (ms)
ttfb: 150 // Time to First Byte (ms)
}