Session options
Set an UUID
This method lets the app pass a UUID (Unique User Identifier) to the analytics (32 characters without dashes, 36 characters with dashes). The field accepts 36 characters maximum.
The UUID can be a unique user identifier or any other information which can be used to uniquely identify a user, an account or a group of users.
This information collection, storage and use must be done in accordance with GRDP regulation in effect in your country.
For more information about GRDP: https://en.wikipedia.org/wiki/General_Data_Protection_Regulation
- Android
- iOS & tvOS
- Web
SmartLib.getInstance().setUUID("uuid");
[SmartLib setUUID:@"uuid"];
SmartLib.getInstance().setUUID("uuid");
Set GDPR preference
Set the GDPR preference for the BkA. If set to GDPR_DELETE
, the analytics session report will be empty.
Values: GDPR_CLEAR
(by default, no encryption), GDPR_ENCRYPTED
(decryption possible on request on analytics server),
GDPR_ANONYMIZED
(no decryption possible), GDPR_DELETE
(no reporting in analytics server)
- Android
- iOS & tvOS
- Web
// Global setting
SmartLib.getInstance().setOption(StreamingSessionOptions.GDPR_PREFERENCE, StreamingSessionOptions.GDPR_CLEAR);
// Per session setting
session.setOption(StreamingSessionOptions.GDPR_PREFERENCE, StreamingSessionOptions.GDPR_CLEAR);
// Global setting
[SmartLib setOption:SMARTLIB_GDPR_PREFERENCE valueWithInt:SMARTLIB_GDPR_CLEAR];
// Per session setting
[session setOption:SMARTLIB_GDPR_PREFERENCE valueWithInt:SMARTLIB_GDPR_CLEAR];
// Global setting
SmartLib.getInstance().setOption(StreamingSessionOptions.GDPR_PREFERENCE, StreamingSessionOptions.GDPR_CLEAR);
// Per session setting
session.setOption(StreamingSessionOptions.GDPR_PREFERENCE, StreamingSessionOptions.GDPR_CLEAR);
Set a device type
This method overrides the default device type detected by the SmartLib.
- Android
- iOS & tvOS
- Web
SmartLib.getInstance().setDeviceType("deviceType");
[SmartLib setDeviceType:@"deviceType"];
SmartLib.getInstance().setDeviceType("deviceType");
Set a custom user agent
This method allows to the app to set the user agent used by the SmartLib during all HTTP requests.
- Android
- iOS & tvOS
- Web
SmartLib.getInstance().setUserAgent("useragent");
[SmartLib setUserAgent:@"useragent"];
SmartLib.getInstance().setUserAgent("useragent");
Set a user agent for ad tracking events
This method allows to the app to set the user agent used by the SmartLib during ad tracking event HTTP requests. It overrides the custom user agent if it has been set.
- Android
- iOS & tvOS
- Web
// Global setting
SmartLib.getInstance().setOption(StreamingSessionOptions.USERAGENT_AD_EVENT, "useragent");
// Per session setting
session.setOption(StreamingSessionOptions.USERAGENT_AD_EVENT, "useragent");
// Global setting
[SmartLib setOption:SMARTLIB_USERAGENT_AD_EVENT valueWithString:@"useragent"];
// Per session setting
[session setOption:SMARTLIB_USERAGENT_AD_EVENT valueWithString:@"useragent"];
// Global setting
SmartLib.getInstance().setOption(StreamingSessionOptions.USERAGENT_AD_EVENT, "useragent");
// Per session setting
session.setOption(StreamingSessionOptions.USERAGENT_AD_EVENT, "useragent");
Set the keepalive frequency
This method allows to change the default keepalive frequency (5000ms by default). The value can be within 5000ms to 60000ms.
If the value exceeds 10000ms, an additional CDN configuration is necessary to prevent the termination of an ongoing session.
- Android
- iOS & tvOS
- Web
// Global setting
SmartLib.getInstance().setOption(StreamingSessionOptions.SESSION_KEEPALIVE_FREQUENCY, 5000);
// Per session setting
session.setOption(StreamingSessionOptions.SESSION_KEEPALIVE_FREQUENCY, 5000);
// Global setting
[SmartLib setOption:SMARTLIB_SESSION_KEEPALIVE_FREQUENCY valueWithInt:5000];
// Per session setting
[session setOption:SMARTLIB_SESSION_KEEPALIVE_FREQUENCY valueWithInt:5000];
// Global setting
SmartLib.getInstance().setOption(StreamingSessionOptions.SESSION_KEEPALIVE_FREQUENCY, 5000);
// Per session setting
session.setOption(StreamingSessionOptions.SESSION_KEEPALIVE_FREQUENCY, 5000);
Set a custom session parameter
This method lets the app passes custom parameters to the analytics server. It can to be called before starting (i.e before calling getURL
) or during a session.
Parameters are sent to the analytics server during session.stopStreamingSession()
- Android
- iOS & tvOS
- Web
session.setCustomParameter("name", "value");
[session setCustomParameter:@"name" value:@"value"];
session.setCustomParameter("name", "value");
Predefined values:
- Android
- iOS & tvOS
- Web
// Add a pre startup time
session.setCustomParameter("pre_startup_time", "in_ms");
// Add a pre startup time
[session setCustomParameter:@"pre_startup_time" value:@"value_in_ms"];
// Add a pre startup time
session.setCustomParameter("pre_startup_time", "in_ms");