Absolutely! However there's a few intricacies you need to be aware of when measuring these with the raw browser APIs. For example for LCP: web.dev/articles/lcp#differences-metric-api. That's why we recommend the open-source web-vitals library to take of that for you: github.com/GoogleChrome/web-vitals. And btw, that's exactly what DevTools uses for this new Live Metrics screen!
Is it possible to collect metrics through a browser API?
Some might prefer to keep this data on their own db
Absolutely! However there's a few intricacies you need to be aware of when measuring these with the raw browser APIs. For example for LCP: web.dev/articles/lcp#differences-metric-api. That's why we recommend the open-source web-vitals library to take of that for you: github.com/GoogleChrome/web-vitals. And btw, that's exactly what DevTools uses for this new Live Metrics screen!
Love your videos. Thanks for the effort. How does Google collects filed data ? I I’ll this work for pages which requires login as well ?
CrUX field data is collected from chrome users who've opted-in to sending their browser perf metrics back to google
@@pry0rity-vids Exactly that. You can search for "CrUX methodology" to learn more about how it works.
Correct! More details here: developer.chrome.com/docs/crux/methodology