In Google Analytics, "Screen Resolution" is a default dimension under Audience > Technology > Browser & OS reports, but pixel density is nowhere to be found.

How can I use Google Analytics to determine how many of my visitors are using Retina or other high-def displays?


Google Analytics does not support pixel ratio by default but you can add it with script for a custom variable. See https://github.com/tysonmatanich/GetDevicePixelRatio for more details.


Lets turn that around and ask why would you care?

Assuming it's to determine if image/icon size is an issue, I've recently tossed all the multiple-resolution icons and replaced them with SVG graphics. Logos and larger non-vector images are all 2x size in a plain <img> tag.

Positive side effects are faster loads (the SVG is in the main style sheet) and easier modification. Haven't encountered any negative side effects yet.

If IE8 compatibility is required I will run one sprite file - make one page with all your icons and you can just screencapture it for instant sprites.

  • 1
    You should care as if there's no high pixel ratio users, then sending everyone 2x sized images is a grand waste of everyone's time and resources. Also if everyone happens to be using 3x pixel ratio devices, then you still aren't providing full res pictures to your user base. – andrewb Mar 26 '15 at 22:30
  • 1
    Some typefaces (esp if you are considering system fonts to maximize application performance) look great on retina displays, but terrible on standard resolution displays. We're considering this very thing for github.com right now. – Joel Glovier Jun 9 '16 at 15:03
  • How do you convert photos to SVG? – KaptajnKold Jan 12 '18 at 10:46

Well, you can look at the Operating System of your users, if it's an iOS or Macintosh you can assume they use retina displays.

  • Is this true of all Macs? At what point did this become always true? – John Conde Jan 24 '18 at 13:29
  • 1
    it's NOT true on all Mac OS - for example, Macbook Air has no retina display and is a popular laptop. – Vojtech Kurka Aug 3 '18 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.