includeDefaultCustomVariable
The includeDefaultCustomVariable property controls whether the SDK populates the visit-scoped custom variables on indexes 1, 2 and 3 with the platform name, OS version and app version. The flag is turned on by default. Turn it off when you want to use indexes 1-3 for your own data.
Syntax
PiwikTracker.sharedInstance()?.includeDefaultCustomVariable = includeDefaults[PiwikTracker sharedInstance].includeDefaultCustomVariable = includeDefaults;Parameters
- includeDefaultCustomVariable (boolean, required)
Whentrue, the SDK automatically sets visit-scoped custom variables 1, 2, and 3 to the platform name, OS version, and app version.
When false, the SDK doesn't set these custom variables. You can use indexes 1, 2, and 3 with setCustomVariable() (see scope), provided they aren't already in use.
Examples
To disable automatic tracking of the device type, OS version, and app version:
PiwikTracker.sharedInstance()?.includeDefaultCustomVariable = false[PiwikTracker sharedInstance].includeDefaultCustomVariable = NO;Notes
- When
includeDefaultCustomVariableistrue, the SDK uses custom variable indexes 1, 2, and 3 for the platform name, OS version, and app version.
Related methods
Updated 2 months ago
Did this page help you?