How I use Google Analytics for Mobile Apps

Google Analytics is a service that collects information about web site visits and then displays it in the form of charts and tables. In this post I will enumerate reports and pages that I use for my Android application.

Visits by country

It is the main report and it can be seen by using Audience->Geo->Location. It will display the countries on the map as well as in the table.
Also if you click on any country in the list, it will display the list of areas (or states) and the list of cities.
visits_location
It is very similar to the Google Play statistics which shows installs by country:
installs_country
But Google Analytics has more data and shows real usage instead of one-time installs.

Android OS versions

Android versions can be viewed without custom reports, but the sequence of actions is quite tricky Audience->Technology->Browser & OS->click Primary Dimension: Operating System->click Anroid row.
android_os_versions
It is similar to the Google Play statistics which shows install by Android version:
installs_version

Device brands

Shows the most popular companies that produce Android phones and tablets.Audience->Mobile->Devices->click Primary Dimension: Mobile Device Branding.
After clicking on a company name the list of device names will be displayed (but it displays incomprehensive codes like GT-I9300 instead of actual names).
android_devices_brands

Page Views

I have added a code like this to each Android activity class:

public class PostsListActivity extends Activity {
    // ...
    public void onCreate(Bundle savedInstanceState) {
        // ...
        GoogleAnalyticsTracker.getInstance().trackPageView("PostsListActivity");
    }
    
    // ...
}

So each activity class is considered to be a web page and you can see page views report by using Behavior->Site Content->All Pages
visits_pages
My Android app has 9 activities and in the table I can see how often users visit specific activities and how much time they spend on each activity.

Various actions performed by users

I used to track user actions a year ago, but stopped to do this because it was difficult to use this functionality and collected information was useless anyway.
Here is an example of a user event: your app has a button “Download file” and you want to know how often it is clicked. So you can use the following code:

downloadButton.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {
        // ... download file ...
        GoogleAnalyticsTracker.getInstance()
            .trackEvent("UI", "Download File", "By clicking button", 0);
    }
});
  1. “UI” is the topmost category that groups all events related to user interface. You can give any name to this category, no matter whether it is “UI” or “User Interface”
  2. The next parameter is the name of the action, here it is “Download File”, other actions can be “View Image”, “Click Close Button”, etc.
  3. The third parameter is optional, but you can add some other information too, for example, whether this event was induced by clicking the button on the page, or by using a context menu, or by using the action bar.
  4. The forth parameter is optional too, I just pass 0.

Then you can see received evens in the section Behavior->Events->Top Events. At first you will see the list of categories (1st parameter), then you can click on any category and see the list of actions (2nd parameter), and each action contains the list of labels (3rd parameter)
analytics_events

Custom Reports: Android OS versions

You can create your own reports as well by clicking on the Customization tab. Here is an example how to reproduce the OS versions report which I described above.
To the Metric Groups section add the following metrics: Unique Visitors, Visits, Pages / Visit, Avg. Visit Duration.
To the Dimension Drilldowns section add: Operating System Version Mobile Device Info
The configuration process will look like this:
custom_report_os_versions
And your customized report will look like this:
custom_report_os_versions_view

Some downloadable dashboards and reports

You can download and use custom dashboard from here: Dashboard 70 – Facts about visitors.
And a report that displays visits by hours and days of weeks: Google Analytics – Hours & Days Report

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: