Skip to content

Commit

Permalink
[docs] Round the devicePixelRatio
Browse files Browse the repository at this point in the history
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 #21209 (comment).
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.
  • Loading branch information
oliviertassinari committed May 30, 2020
1 parent 9864348 commit e38a2af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

This comment has been minimized.

Copy link
@eps1lon

eps1lon May 30, 2020

Member

Google Analytics doesn't provide any tool to group close values.

We can always regexp them in analytics. Data should be stored raw. Otherwise please explain the .1 rationale

This comment has been minimized.

Copy link
@oliviertassinari

oliviertassinari May 30, 2020

Author Member

My hope is that we can render an histogram graph without much effort. 0.1 should be large enough to plot a distribution graph, while small enough so that data higher resolution doesn't matter. I even wonder if 0.25 as the smallest unit wouldn't be enough.

Capture d’écran 2020-05-30 à 17 48 49


matchMedia = window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);
// Need to setup again.
Expand Down

0 comments on commit e38a2af

Please sign in to comment.