Custom screen and application variables

  • iOS
  • watchOS
  • tvOS


Custom application variables allow you to associate information with a user’s activity while s/he is using your application.

Custom screen variables focus on a view in particular, and allow you, notably, to tag the fields of an entry form.


Get off to a good start

Once your tag is initialised, you can add your custom variables to your screen hit.

In the case of a Swift project, be sure to import the SmartTracker (or tvOSTracker/watchOSTracker if your target is an Apple TV or an Apple Watch) module in your ViewController. In the case of an Objective-C project, be sure to import the headers SmartTracker-Swift.h or Tracker-Swift.h in case of Cocoapods integration.



The Screen object makes available a CustomVars-type object that exposes an add method. This method accepts three parameters:

  • varId: index of the indicator
  • value: value of the indicator, character string in the format:
    • text: [lorem]
    • decimal: “,” or “.” separator, two characters maximum after the separator
    • date: yyyymmdd
    • country: ISO
    • duration: integer
  • type : type of indicator

Tagging example

  1. Site indicator, with a date value

  2. Screen indicator, with a text value


CustomVar class



Name Type Default value Description
varId Int 1 Gets or sets the variable ID
type Enum CustomVarType.App Gets or sets the variable type
value String Empty string Gets or sets the variable value
Was this post helpful?
Last update: 23/02/2018