amp.dev
amp.dev copied to clipboard
CLS collected from AMP via Google Analytics (Universal Analytics) missing data
When collecting CWVs on AMP following this example, some floating points seem to be incompatible with either/both Universal Analytics (GA) or/and BigQuery. CLS seems to be the most affected metric due to the nature of the values reported by the underlying web_vitals.js. The majority of the data with decimal points seems to be treated as Null when they are being exported to BigQuery from GA, they could also have been truncated when GA is receiving the pings from the page.
Similar application of web_vitals.js under a non-AMP situation when GA4 is used (built-in CWV template) seems to work around the issue by multiplying the values by 1000 so that the portion after decimal point is preserved.
Related to https://github.com/ampproject/amp.dev/issues/5570
This can be done in AMP via $CALC(${cumulativeLayoutShift}, 1000, multiply)
.
thanks for the fix, @micajuine-ho! I moved the issue over to the site so we can track the docs being updated
Thanks Micajuine! Do publishers need to apply this to other metrics such as LCP as well?