Skip to main content

Session options

Session customization

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

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)

// 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.

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.

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.

// 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.

caution

If the value exceeds 10000ms, an additional CDN configuration is necessary to prevent the termination of an ongoing session.

// 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()

session.setCustomParameter("name", "value");

Predefined values:

// Add a pre startup time
session.setCustomParameter("pre_startup_time", "in_ms");