In the upcoming 202002 release (scheduled for March 10th) we will be changing how CLS
values are represented in the dataset. In short, we will be dividing all of the start and end values by 100
. For example, the smallest bin is 0 - 5 (integers) and that will become 0.00 - 0.05 (decimals). To be clear, we are only changing how the CLS values are represented, in the same way that 5% is equivalent to 0.05, and the distribution itself will be unchanged.
Why are we making this change?
This change is to become more consistent with the Layout Instability API
, which produces layout shift scores in decimal format.
What about consistency with older datasets?
To ensure continuity for queries that span multiple monthly datasets, we will apply this change to all datasets after CLS was introduced in the 201905
What do I have to do?
Update any existing CLS queries to expect bins with 0.05 rather than 5 granularity. For example, if you have a query to sum the CLS densities where bin.end<=5, it may start to return values much larger than before. You might also need to update the schema of any tables containing post-processed CLS values from INT64 to NUMERIC.
Why not FLOAT64?
type in BigQuery is an approximation and you may sometimes experience precision issues like 0.003 represented as 0.003000001. The NUMERIC
type doesn't have precision issues.