-
Notifications
You must be signed in to change notification settings - Fork 227
Description
Is your feature request related to a problem? Please describe.
This library includes the web-vitals.js library to allow measurement of Core Web Vitals (recently upgrades in #1412 - thanks!).
The basic version of the library is currently loaded by default using https://unpkg.com/web-vitals@3/dist/web-vitals.iife.js.
This allows measurement of the Core Web Vitals metrics (LCP, CLS, INP...etc.) values.
The web-vitals library also includes an attribution build, which provides additional debugging information (for example which element was the LCP, or breaking down the LCP time into subparts). The additional details available for each metric are shown here: https://github.com/GoogleChrome/web-vitals#attribution
Should this be an option for snowplow analytics?
Describe the solution you'd like
I think, from previous discussions that sites could override the script to load the web-vitals.attribution.iife.js
attribution build instead if they wanted? So maybe that's sufficient? But ideally it would be easier/more obvious how to do this.
Additionally, I think the schema would need to change to allow tracking of these additional pieces of information.
If the schema is used, then would need to decide what additional information to store. Some of the "entries" are complex objects, but the main details are pulled out of those so probably only the strings and values need to be stored and the entries could be skipped?
Describe alternatives you've considered
We could just update the docs, to make it clear how to collect these through custom metrics (if snowplow has such a concept?) rather than adjusting the main schema?
Alternatively we could enable the attribution by default since, in our opinion, those interested enough to track Core Web Vitals, would benefit from this data in order to optimise them. That would have a small overhead as there are more calculations done, and also more data to store but we do try to keep these to a minimum since we're obviously very conscious of performance when building this library!
Additional context
I'm one of the maintainers of this library, so happy to answer more questions on this.