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 - When true, the SDK fills visit-scoped custom variable slots 1, 2 and 3 with platform name, OS version and app version. When false, those slots are not set by the SDK and you can use them with setCustomVariable() (visit scope), as long as no index conflict remains.

Examples

To turn off automatic fetching of device type, OS version and app version from the device:

PiwikTracker.sharedInstance()?.includeDefaultCustomVariable = false
[PiwikTracker sharedInstance].includeDefaultCustomVariable = NO;

Notes

  • If includeDefaultCustomVariable = YES is set, indexes 1-3 are used to track device type, OS version and app version as custom variables.

Related methods