Track custom variables
Usage
Section titled UsageCustom variables provide additional information about the page, user, or session, which is sent along with screenviews.
For example, they can contain details about the current layout of a screen, such as day/night mode.
Limits
Section titled LimitsOn the server side
Section titled On the server side- A maximum of 20 distinct custom variables per screenview can be stored. If more are received, only the first 20 custom variables, based on their
index
value, will be retained. - The
index
value of the custom variable determines which ones will be retained. Only index values from 1 to 20 (inclusive) will be considered.
On the SDK side
Section titled On the SDK side- Every custom variable is composed of
index
,name
andvalue
. - If the same
index
is used twice in the same screen, only the first (name
,value
) pair associated with theindex
will be kept. - A maximum of 20 custom variables can be stored on the same screenview.
- If the maximum character length is reached for
name
(512 characters) orvalue
(255 characters), the SDK will automatically truncate the additional characters automatically. - If
name
orvalue
are empty, the SDK will instead send the literal string"cs-empty"
. - Maintain a consistent index for a given custom variable throughout the application. For example, if the “screen layout” is collected with an
index
of 3, use the slot 3 for this information on every screen of the application.
Defining custom variables
Section titled Defining custom variablesTo define and send custom variables, follow this implementation: