CWV metrics
Share metrics with us
When you are already using a web-vitals library for other purposes, you can chose to actively pass metrics to our script. This prevents the need of needing to embed the web-vitals library twice.
To share information of each metric with our monitoring, you should call the rumv
function and pass webvitals
as the first parameter. Metric information, which should be an object, should be passed as a second parameter. It should match the object that the official web-vitals library is using. You should then end up using the following code:
rumv('webvitals', metric );
Do note that responsibility of loading the right version of the library and sharing the right information lies with you/the user, ensuring accurate and efficient data management in their projects.
For example, when enabling specific tracking settings at a certain point -such as attribution tracking to get metric breakdown/sub-parts-, you need to update your library too in order to actually collect additional data.
Re-use our metrics
You can re-use the metric information that our JavaScript collected already. This prevents the need of needing to embed the web-vitals library twice.
To receive information per metric, you can call the rumv
function and pass webvitals
as the first parameter. Your callback function which you want to receive metric information should be passed as a second parameter.
rumv('webvitals', yourWebvitalsCallback );