-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] Track pixel ratio #21209
[docs] Track pixel ratio #21209
Conversation
* Adjusted to track 3 or more different ratios | ||
*/ | ||
function trackDevicePixelRation() { | ||
window.ga('set', 'dimension3', window.devicePixelRatio); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already added to google-analytics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious to see if we will get a long tail of values with decimals. Say, 2.33, 2.19, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that we need to round the number. Are you able to process the information in this GA view?
Details of bundle changes.Comparing: a2e0e32...ebea1b8 Details of page changes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be interesting to watch! I have been eager to add this in the past at two other companies (2016 & 2018) :)
I would guess between 40% and 33% of our audience has window.devicePixelRatio
>= 2.
- All the new mac sold are high-density, mac is 37% of the audience for returning users.
- +80% of the designers have a high-density screen.
- +80% of the phones have a high-density screen.
* Adjusted to track 3 or more different ratios | ||
*/ | ||
function trackDevicePixelRation() { | ||
window.ga('set', 'dimension3', window.devicePixelRatio); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious to see if we will get a long tail of values with decimals. Say, 2.33, 2.19, etc.
This is an effort to reduce the concerns raised in mui#21209. We don't need to duplicate the information for the 1px web <-> 1px screen variant of the images.
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 mui#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.
Helps for decisions when we might want to add special hints for different screen ratios. If we have a big spread of ratios we should include them, otherwise not so much.
Also helpful if creating srcSets for 2x displays is useful.
Used the opportunity to refactor our
PersistState
which is really an "Analytics"-component.