Track App States

States are the different screens or views in your application. Each time a new state is displayed in your application (for example, when a user navigates from the home page to the news feed), you should send a track state call. On iOS, a state is typically tracked in the viewDidLoad method of each view.

States are not tracked automatically, you must make a call to trackState.

How to Track

Prerequisites: Add the library to your project and implement lifecycle.

  1. Import the library:
    ;#import "ADBMobile.h"
  2. Call trackState to send a hit for this state view:
    ;[ADBMobile trackState:@"Login Screen" 

The "State Name" is reported in the View State variable in Adobe Mobile services, and a view is recorded for each trackState call. In other Analytics interfaces, View State is reported as Page Name and state views is reported as page views.

Sending Additional Data

In addition to the "State Name", you can send additional context data with each track action call:

NSMutableDictionary *contextData = [NSMutableDictionary dictionary];
[contextData setObject:@"logged in" forKey:@"myapp.login.LoginStatus"];
[ADBMobile trackState:@"Home Screen" data:contextData];

Context data values must be mapped to custom variables in Adobe Mobile services:


App State Reporting

States are typically viewed using a pathing report so you can see how users navigate your app, and which states are viewed most.

Adobe Mobile Services View States Report. This report is based on the paths users took through your application. For example, Login > Home > Settings, or Home > Feed.
Adobe Analytics States can be viewed anywhere Pages can be viewed, such as the Pages Report, Page Views report, and Path Reports.
Ad hoc analytics States can be viewed anywhere Pages can be viewed using the Page dimension, Page Views metric, Path Reports.

Parent topic: Analytics