Back in January, I wrote about the misconception people have about users never resizing their browser window, and vowed to find out the truth by tracking resizes for a mainstream website.
To recap, I inserted a snippet of jQuery into every page of the site, which would report the first instance of a window resize and/or an orientation change to Google Analytics for each pageview.
Here are the key numbers for the period I tested:
- 19,124 visits
- 3,859 unique resizes
- 262 unique orientation changes
Here's what that data is telling us:
- 20.17% of visits had a viewport resize at some point during their session
- Of those resizes, only 6% were an orientation change
Sadly, those numbers immediately call the validity of the data into question --- they simply can't be right. It seems the
resize event is not reliable when used in this way. I tried to think about things that could trigger a
resize event and skew the data:
- Something causes the vertical scrollbar to be shown/hidden, changing the size of the viewport
- A piece of browser chrome, like a toolbar or extension, is shown/hidden, changing the size of the viewport (the "Find in this page" function on IE, Firefox and Opera is a good example)
- The browser goes into full screen mode, changing the size of the viewport.
Since this data is clearly unreliable, I need to find another way to gather the right stats. I'm thinking about measuring the viewport dimensions once on document ready, then again every second, and reporting it as a resize if it's changed 50px or more in either dimension. I'll do some testing with this idea and update this post soon.
Update 17th March 2014: I'm running the experiment again, on the same site, but this time with a better detection script, which only reports a resize if
clientHeight has changed by 50px or more since the document first loaded. It also doesn't depend on jQuery any more. I'll report back in 10 days.
Update 15th April 2014: New findings here.