Click here to see your recently viewed pages and most viewed pages.

Mobile Analytics: An End-to-End Walkthrough

Wes Goodman
February 2011


The Google Analytics Mobile SDK brings all the goodness of web-based Google Analytics to mobile applications on Android and iOS. You can use the SDK to track pageviews, click events, and--on Android--install referrers. Because the mechanism you’ll use is different from the web-based solution, we’ve written this article to illustrate an end-to-end implementation. We’ll start with a basic mobile application, sign up for a Google Analytics account, begin tracking several signals, and show how to view them in the web interface. Without further ado, let’s get started!

Sample Code

We’ll be starting with a sample application that contains two tabs and a few buttons. You can find the sample code in our Mobile Developer Repository.

Your platform of choice:

Finding Data in the Analytics Web Interface

Now that we’ve added all these data collection points to our application, it’s time to see what they look like in the front-end. First we’ll go ahead and load up Analytics, log in, select the proper analytics account, and check out the dashboard. Bear in mind that it can take the analytics front-end up to 24 hours to process newly collected data.

The dashboard defaults to showing visits and pageview statistics. Two other statistics that you might not be familiar with are Bounce Rate and Avg. Time on Site. Bounce Rate is simply the percentage of visits that resulted in only a single pageview being registered. Avg. Time on Site is calculated by taking the difference between the first and final pageview timestamps of a visit; as you might expect, these are then averaged across all visits. Let’s drill down deeper and examine pageview and event information.

Finding Pageview Information

Since we added pageview tracking first, what better place to start? Go ahead and click the ‘Content’ link on the left-hand navigation bar. You’ll be greeted with an overview screen that looks a little something like this:

You’ll notice that I’ve been playing around with the sample app and have racked up a few views. Additionally, you can see how the page hierarchy would work if our sample app had a been set up that way.

Finding Event Information

Now that we’ve taken a brief look at pageviews, let’s take a gander at the other data we’re collecting, events. Click ‘Content’ in the left navigation pane, and then ‘Event Tracking’. The overview page gives you a quick rundown of the total events generated by your users, collated by categories.

You can see that I’ve triggered some events by clicking on the sayHello button, and also by buying a few hats. Drilling down to the ‘boughtHat’ event action, you can see the number of times each label was triggered. Additionally, you can see the values for each label are summed up and their averages displayed.

Finding Android Market Referral Data

If your application is written for Android, the Market allows us to track referral data for installs. This referral information is stored for the lifetime of the application's install, and is transmitted with every tracking event. We can view this data by clicking on ‘Traffic Sources’ in the left-hand navigation column and selecting ‘Campaigns’. Several statistics are available, but the two we are interested in are Visits and % New Visits.

Important: The Visits metric counts both new and returning users. To get the number of installations fueled by a campaign, we want to multiple Visits by % New Visits. Similarly to Google Analytics for the web, a visit is roughly a 30 minute window of interaction with your application.

You can see that this numerous campaigns have been run to advertise this application. By selecting the other drop-down box on the table, you can add additional dimensions, such as source, medium, keyword, and content. These correspond to the referral parameters listed on the Android Market Referral Tracking documentation.

Note that this referral data is stored for the lifetime of the application’s install and is appended to standard pageview and event tracking information. This allows us to slice that information with an addition dimension--usually campaign--to understand how varying groups of users might interact differently with your application.