You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This plugin converts all of the event values to integers before sending to GA, here:
// Google Analytics metrics must be integers, so the value is rounded.ev: parseInt(delta),
Considering the key range for the CLS metric is 0 to 0.25 (with anything above that being "Poor"), the rounded values are meaningless.
The documentation for web-vitals suggests multiplying the value by 1000, or a larger multiplier for greater precision.
// Google Analytics metrics must be integers, so the value is rounded.
// For CLS the value is first multiplied by 1000 for greater precision
// (note: increase the multiplier for greater precision if needed).
eventValue: Math.round(name === 'CLS' ? delta * 1000 : delta),
Without the multiplier, 0.22145 is 0. With the multiplier, it is 221, which will be resolved as 0.221 by dividing the value by 1000 in our reports.
I'll submit a pull request shortly.
The text was updated successfully, but these errors were encountered:
laradevitt
added a commit
to laradevitt/gatsby-plugin-web-vitals
that referenced
this issue
Jun 8, 2021
This plugin converts all of the event values to integers before sending to GA, here:
Considering the key range for the CLS metric is 0 to 0.25 (with anything above that being "Poor"), the rounded values are meaningless.
The documentation for web-vitals suggests multiplying the value by 1000, or a larger multiplier for greater precision.
Without the multiplier,
0.22145
is0
. With the multiplier, it is221
, which will be resolved as0.221
by dividing the value by 1000 in our reports.I'll submit a pull request shortly.
The text was updated successfully, but these errors were encountered: