Screens

Screens are the content that your users view in your app. Using Zoho Apptics' screen tracking, you can measure the screen views and associate the screen data with events. This helps you to understand user engagement and behaviour. 

  • Make sure that you have integrated Apptics with your app, refer to the integration guide for detailed steps.
  • Once the integration is done, you can track the screens either manually or automatically.

Manual screen tracking

  • You can track the screens manually and also provide custom screen names using Apptics. 
  • Use the below method to view the controller class that you want to track.
  • To track the entry of the view, call the method viewDidAppear.
Copied[APScreentracker trackViewEnter:<#(nonnull NSString *)#>];
CopiedAPScreentracker.trackViewEnter(<#T##screenName: String##String#>)
  • To track the exit of the view, call the method viewWillDisappear.
Copied[APScreentracker trackViewExit:<#(nonnull NSString *)#>];
CopiedAPScreentracker.trackViewExit(<#T##screenName: String##String#>)

NOTE: Make sure that screen name follow the below norms, else the event won't be logged within the SDK.

  • screen name is mandatory and cannot be nil or empty.
  • screen name should not be more than 250 characters.
  • should start with an alphabet.
  • only numbers, spaces, dots, and underscore are allowed after the first letter.
  • cannot start with 'ap_' or 'AP_'. These are reserved for the defined events.

An example of a screen name : 'Hello World' , 'Hello_World' , 'hello.world'
An example of an invalid screen name : '_hello' , '1hello' , `Hello-World` , 'ap_hello`

Automatic screen tracking

We have disabled automatic screen tracking to avoid all screens getting tracked.

Add a property name 'ap_screen_name' to the screens (view controller) that needs to be tracked automatically. Assign the screen name to the 'ap_screen_name' variable which will be used for tracking purposes.

NOTE: Existing screens will be tracked as usual from the old SDK. Once you update the SDK version, use ap_screen_name = NSStringFromClass(self.classForCoder) to assign the view controller's name to the variable `ap_screen_name`. This will ensure that the existing screens are tracked as before. For the new screens, you should provide meaningful names to the ap_screen_variable.

Declare a property named ap_screen_name in the header file (.h).

Copied@property (nonatomic, retain) NSString *ap_screen_name;

And assign the value to the property in implementation file (.m) inside the viewDidLoad method. You can use dot notation or square brackets.

Copiedself.ap_screen_name = @"Custom screen name"; 
//or
[self setAp_screen_name:@"Custom screen name"];
Copied@objc var ap_screen_name: String = "Custom screen name"

NOTE: You must use enableAutomaticScreenTracking property of the AppticsConfig class to turn off automatic screentracking or by passing false to the enableAutomaticScreenTracking method belonging to the Apptics class. By default automatic screen tracking is enabled.