Quantcast
Channel: Piwik Forums - Support & Bugs
Viewing all articles
Browse latest Browse all 13117

Re: HiDPI display visits

$
0
0
The solution for Piwik (asuming you use the async tracker) is very similar:

var devicePixelRatio=(window.devicePixelRatio>1)?window.devicePixelRatio:'normal or unknown'; 
_paq.push(['setCustomVariable',1,'devicePixelRatio', devicePixelRatio, 'page']);

This could, of course, need some testing and verification. You should probably test to see that 'devicePixelRatio' is available in the window object before using it.

var devicePixelRatio=('devicePixelRatio' in window)?window.devicePixelRatio:'unknown'; 
_paq.push(['setCustomVariable',1,'devicePixelRatio',devicePixelRatio,'page']);

Viewing all articles
Browse latest Browse all 13117

Trending Articles