amp.dev
amp.dev copied to clipboard
Amp Analytics CLS w/ GA add precision tip
When tracking CLS using GA, they state that they can only collect integer values and so it is recommended that you multiply the collected CLS value by 1000 to get greater precision.
https://github.com/GoogleChrome/web-vitals#using-analyticsjs
A tip here, would be helpful.
Something along the lines of:
TIP: For greater precision, multiply the CLS value collected by 1000 to be sent to GA:
$CALC(${cumulativeLayoutShift}, 1000, multiply)
FYI: new $CALC macro was just added: https://github.com/ampproject/amphtml/pull/33383 which lead to this convo.