From e38a2af8f2780d1d780a74cfb4b30ca1b1f365e0 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Sat, 30 May 2020 15:54:02 +0200 Subject: [PATCH] [docs] Round the devicePixelRatio Google Analytics doesn't provide any tool to group close values. We have to group the value ourselves to reduce the cardinality of the possible values this dimension can take. After 24 hours, we had 185 different values https://github.com/mui-org/material-ui/pull/21209#discussion_r431409130. After 4 days, we had 357 different values. My hope is that we will have most of the values (> 1%) on less than 40 possible values). This will make studying the result easier. --- docs/pages/_app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/_app.js b/docs/pages/_app.js index bfcc1ff85c0eb9..c15f4fb9e6197b 100644 --- a/docs/pages/_app.js +++ b/docs/pages/_app.js @@ -160,7 +160,7 @@ function Analytics() { * Adjusted to track 3 or more different ratios */ function trackDevicePixelRation() { - window.ga('set', 'dimension3', window.devicePixelRatio); + window.ga('set', 'dimension3', Math.round(window.devicePixelRatio * 10) / 10); matchMedia = window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`); // Need to setup again.