tech support 8

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Thursday, 17 January 2013

My Viewport Sizes

Posted on 21:14 by Unknown

Screen shot of my desktop.
Yes, that is my two monitor set-up — one display at 1,920 × 1,080 (with a browser at whatever size will fit my tabs) and one at 1,024 × 1,280 (with a browser always at 1,024 × 1,024). My browser reports two different screen resolutions depending which display the browser is using.




During the last rebuild of my site at least two years ago I started to track the viewport sizes of my visitors via Google Analytics. Since I don't care much about screen resolution (screen size), I don't bother to track it.




Yesterday I saw a post that tracks screen sizes between technical and not-so-technical visitors to the author's site. While the information is interesting, it doesn't include any viewport data, which happens to be what I care about.




This motivated me to jump into my Google Analytics and pull the viewport data that I have. The chart below represents what I found:











What I've done is grabbed the last 500 visits to my site for which I have data (even bad data) and plotted them in a scatter chart without regard to the frequency of a particular resolution. To be clear, this isn't scrubbed data and it's not from a site targeted at the general web user.




The block of code I use to get this data into Google Analytics does the job. I borrowed the code from the post Measuring browser viewport size with Google Analytics, though I make my viewport(); call at the end of the page, not in the body.




function viewport() {
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement &&
( document.documentElement.clientWidth
|| document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body &&
( document.body.clientWidth
|| document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
_gaq.push(['_trackEvent',
'Viewport',
'Size',
myWidth+'x'+myHeight]);
_gaq.push(['_trackEvent',
'Viewport',
'Width',
myWidth+'x'+myHeight,
myWidth]);
_gaq.push(['_trackEvent',
'Viewport',
'Height',
myWidth+'x'+myHeight,
myHeight]);
}



Hopefully that's enough to get your started on tracking viewport stats for visitors to your site. If you see ways I can improve it, then please do let me know. I can update this and we can all benefit.




If you are curious why I chose to skip tracking screen size and just focus on viewport size, I refer you to an article I wrote 13 years ago, along with more recent articles from me and others.




  • Real-World Browser Size Stats, Part I, July 4, 2000.

  • Real-World Browser Size Stats, Part II, July 4, 2000.

  • Browser viewport statistics, November 10, 2009.

  • Screen Resolution ≠ Browser Window, June 17, 2011.

  • Browser screen resolution stats rile devs, April 13, 2012.

  • Where's the Viewport Size Data? April 13, 2012.



Update: February 15, 2013




Welcome, visitors from the below tweet. Please post your own comments or even your own stats. I would love to see them.



What if we stopped measuring screen resolution and started measuring browser viewports instead? - bit.ly/149AFpk / cc: @ppk

— Smashing Magazine (@smashingmag) February 14, 2013



Update: November 13, 2013




To quote PPK, screen.width is useless. Devices don't consistently report device pixels or viewports in a consistent way. There is clearly still value in having some numbers, though the quality of those numbers is always suspect.

Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in analytics, browser | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Copying Content Styled with Text-Transform
    Using the CSS property text-transform to automatically shift copy to uppercase has been popular for a while now, but a combination of a rec...
  • HTML5 Finally Gets... a Logo?
    Start Rant With all the debate about elements , attributes , semantic meaning and who really owns HTML5 , it's thrilling to see that t...
  • New Google Analytics Features
    In the article " Google Analytics Now More Powerful, Flexible and Intelligent " from last Tuesday (yes, I know I'm behind on t...
  • Speaking: Accessible Web Apps & Standards
    I will be speaking twice in September, both of them sponsored by Infotech Niagara. If you're in the Buffalo area, these are great opport...
  • Speaking at WordCamp Buffalo 2013
    This Saturday I will be speaking at Buffalo's second WordCamp . Last year was a great day-long event filled with many good speakers (not...
  • CSS-D Finds New Home at evolt.org
    The incredibly popular, active, and valuable mailing list devoted to Cascading Style Sheets, CSS-Discuss (css-d), has moved its hosting to ...
  • Google Chrome Pre-Installed on Sony PCs
    Google cut a deal with Sony's PC division to distribute Chrome as a pre-installed browser on their Vaio PCs. Google claims to be in talk...
  • Test in Lynx and Print, It's Your Job
    I have admittedly not taken the time to attend An Event Apart any of the times it's been held, but I do tend to follow the #aea hashtag...
  • Netscape Navigator 2.01 Celebrates 16th Anniversary
    As of March 18, 2011 Netscape Navigator version 2.01 has turned 16 years old . Back when it was released in 1996 it was the bees knees. It i...
  • Thanksgiving, Technology, and Just Picking a Fight
    My logs tell me that nobody took this 2011 plea seriously. I blame the typeface. Last year on Thanksgiving I made the case for ignoring soci...

Categories

  • accessibility
  • Adobe
  • analytics
  • Apple
  • apps
  • ARIA
  • Bing
  • Blink
  • Brightkite
  • browser
  • Buzz
  • Chrome
  • clients
  • css
  • design
  • Facebook
  • Firefox
  • Flash
  • fonts
  • food
  • Foursquare
  • g11n
  • geolocation
  • globalization
  • Google
  • Gowalla
  • html
  • i18n
  • ICANN
  • infographic
  • Instagram
  • internationalization
  • internet
  • Internet Explorer
  • JavaScript
  • JAWS
  • Klout
  • L10n
  • law
  • localization
  • Lynx
  • Mapquest
  • Microsoft
  • mobile
  • Netscape
  • ning
  • Opera
  • patents
  • picplz
  • Plus
  • print
  • privacy
  • project management
  • QR
  • rant
  • RSS
  • Safari
  • SCVNGR
  • search
  • SEM
  • SEO
  • social media
  • Sony
  • speaking
  • standards
  • SVG
  • touch
  • translation
  • Twitter
  • typefaces
  • usability
  • UX
  • Verizon
  • video
  • W3C
  • WAI
  • WCAG
  • WebKit
  • whatwg
  • Wired
  • WOFF
  • xhtml
  • Yahoo
  • YouTube

Blog Archive

  • ▼  2013 (39)
    • ►  December (1)
    • ►  November (7)
    • ►  September (4)
    • ►  July (3)
    • ►  June (2)
    • ►  May (5)
    • ►  April (3)
    • ►  March (6)
    • ►  February (2)
    • ▼  January (6)
      • Still Guessing on Accessibility
      • My Viewport Sizes
      • App Store Meta Tags
      • Facebook Graph Search and Lessons from Timeline
      • Letting Mobile Users See Desktop View of RWD Site
      • Google Maps: Misbehaving with UA Sniffing
  • ►  2012 (63)
    • ►  December (2)
    • ►  November (4)
    • ►  October (5)
    • ►  September (5)
    • ►  August (4)
    • ►  July (6)
    • ►  June (7)
    • ►  May (7)
    • ►  April (8)
    • ►  March (5)
    • ►  February (3)
    • ►  January (7)
  • ►  2011 (67)
    • ►  December (5)
    • ►  November (7)
    • ►  October (5)
    • ►  September (4)
    • ►  August (8)
    • ►  July (3)
    • ►  June (8)
    • ►  May (3)
    • ►  April (1)
    • ►  March (6)
    • ►  February (6)
    • ►  January (11)
  • ►  2010 (100)
    • ►  December (8)
    • ►  November (7)
    • ►  October (5)
    • ►  September (10)
    • ►  August (7)
    • ►  July (11)
    • ►  June (12)
    • ►  May (6)
    • ►  April (8)
    • ►  March (10)
    • ►  February (5)
    • ►  January (11)
  • ►  2009 (51)
    • ►  December (9)
    • ►  November (6)
    • ►  October (21)
    • ►  September (13)
    • ►  August (2)
  • ►  2003 (3)
    • ►  October (1)
    • ►  January (2)
  • ►  2002 (9)
    • ►  December (1)
    • ►  June (3)
    • ►  April (1)
    • ►  March (3)
    • ►  January (1)
  • ►  2001 (1)
    • ►  February (1)
  • ►  2000 (4)
    • ►  October (1)
    • ►  July (1)
    • ►  June (1)
    • ►  January (1)
  • ►  1999 (7)
    • ►  November (1)
    • ►  September (2)
    • ►  August (2)
    • ►  July (1)
    • ►  June (1)
Powered by Blogger.

About Me

Unknown
View my complete profile