Visits to your site from browsers that do not run javascript will not be tracked by the standard Google Analytics Tracking Code (GATC). This isn’t a huge problem on most sites. On mobile sites, however, this can mean that you are not collecting data on a significant percentage of your visitors.

When I implemented mobile tracking on a site, I (very wrongly) used the sites regular “UA” account number. Mobile page views were indeed tracked, but only as one visitor. To say this another way, all mobile visitors activity looked as if they were coming from one single, long visit with a ton of page views. When I used the proper, mobile account number things started looking much better. This is strange behavior, but someone reported the same problem in the GA support forum. So, learn from my mistake.

To get started with Google Analytics mobile tracking, get your mobile Google Analytics account number by creating a new GA profile or hitting the “check status” link on an existing profile’s settings page. Once you are on the page that contains the standard tracking code, click over to the advanced tab and select the “A site built for a mobile phone” radio button. You’ll see some example code (the default is PHP). Your mobile GA account number is listed near the top (“$GA_ACCOUNT = “MO-XXXXXXX-X”;”). It will look pretty much the same as your regular account number with one exception. The first two letters will be “MO” rather than “UA”.

One other caveat here is that you should not attempt to use both the standard GATC and the server side tracking code on the same page.

Post navigation

One thought on “Google Analytics Mobile Tracking With Rails”

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Learn More)