Google Analytics

Screen Tracking - iOS SDK

This document provides an oveview of screens and how to measure screen views using the Google Analytics SDK for iOS v2.

  1. Overview
  2. Automatic Screen Measurement
  3. Manual Screen Measurement

Overview

Screens in Google Analytics represent content users are viewing within your app. The equivalent concept in web analytics is a pageview. Measuring screen views allows you to see which content is being viewed most by your users, and how are they are navigating between different pieces of content.

A screen view consists of a single string field that will be used as the screen name in your Google Analytics reports.

Screen view data is used primarily in the following Google Analytics reports:

  • Screens report
  • Engagement Flow
  • Goal Flow

Implementation

The following sections will show you how to implement manual and automatic screen measurement. Using automatic screen measurement allows you to quickly implement screen measurement across all of your app's views, while manual screen measurement can also be used if you want to send additional screen views to Google Analytics.

Automatic Screen Measurement

You can automatically measure views as screens using the GAITrackedViewController class. Have each of your view controllers extend GAITrackedViewController, a convenience class that extends UIViewController, and provide the view name to give to the view controllers in your reports.

For example, suppose you have an "About" view that you want to measure with a view controller header that looks like this:

@interface AboutViewController : UIViewController

You would update this header to say:

#import "GAITrackedViewController.h"

@interface AboutViewController : GAITrackedViewController

You must also provide the view name to be used in your Google Analytics reports. A good place to put this is the view controller's initializer method, if you have one, or the viewDidAppear: method:

- (void)viewDidAppear:(BOOL)animated {
  [super viewDidAppear:animated];
  self.trackedViewName = @"About Screen";
}

As long as trackedViewName is set before sendView: is called, automatic view measurement will take place. Whenever the view appears, a call to sendView: with the provided view name will be generated.

Manual Screen Measurement

To manually send a screen view, call sendView: as in the following example:

  [tracker sendView:@"Home Screen"];

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.