How to track viewport sizes with GA

If anyone is interested this is how to add Google Analytics tracking code to a site to record the viewport size of visitors.

GA gives stats for visitors’ monitor resolution, but not the more important viewport size (the actual size of the browser window the visitor is using). However this information can be gained:

Firstly the site will need to use the new Google Asynchronous tracking code. See Introduction to ga.js (Legacy)  |  Analytics for Web (ga.js)  |  Google for Developers

Copy the GA code to your clipboard. In Freeway, go to Page > HTML Markup. In the popup menu, choose “Before ”, paste in your code, and click OK. It’s important that you set the dropdown before pasting the code or it winds up in the wrong section.

Secondly the code at the following site needs to be added to your site: http://beantin.se/post/354097397/track-viewport-google-analytics#comment-6a0120a76d2282970b013486484211970c (please note I can not vouch for this code, I’m using it and assume it is ‘safe’).

For the first section (the part that goes in the Head), you will want to go to Page > HTML Markup and choose “Before </head”> in the pop up menu, then paste in the code. Click OK.

For the second portion of code, you will need to go to Page > Extended. Click the New button. In the Name field, enter “onLoad”, without the quotes. In Value, enter “viewport()”, also without the quotes. Click OK.

Give it 24 hours and hay-presto GA will give you viewport stats.

Cheers


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks for sharing, Mark.

Joe

On 19 Aug 2010, at 10:34, Mark wrote:

If anyone is interested this is how to add Google Analytics tracking code to a site to record the viewport size of visitors.

GA gives stats for visitors’ monitor resolution, but not the more important viewport size (the actual size of the browser window the visitor is using). However this information can be gained:

Firstly the site will need to use the new Google Asynchronous tracking code. See Introducción a ga.js (heredado)  |  Analytics for Web (ga.js)  |  Google for Developers

Copy the GA code to your clipboard. In Freeway, go to Page > HTML Markup. In the popup menu, choose “Before ”, paste in your code, and click OK. It’s important that you set the dropdown before pasting the code or it winds up in the wrong section.

Secondly the code at the following site needs to be added to your site: Measuring browser viewport size with Google Analytics (please note I can not vouch for this code, I’m using it and assume it is ‘safe’).

For the first section (the part that goes in the Head), you will want to go to Page > HTML Markup and choose “Before </head”> in the pop up menu, then paste in the code. Click OK.

For the second portion of code, you will need to go to Page > Extended. Click the New button. In the Name field, enter “onLoad”, without the quotes. In Value, enter “viewport()”, also without the quotes. Click OK.

Give it 24 hours and hay-presto GA will give you viewport stats.

Cheers


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options