In this document you will learn of the advanced SOOMLA SDK setup options:
- Special Initialization Configuration
- User Consent Status (GDPR)
- Tagging Users
- Change User ID
- Add Extra User Id
- Override User Country Code
Special Initialization Configuration
To initialize SOOMLA SDK with special configuration you will need to pass the initialization function with a config object. config object is created with a builder, as shown below.
Note: none of the following attributes are mandatory
var soomlaConfig:SoomlaConfig = new SoomlaConfig();
soomlaConfig.collectAdvertisingId = false; // Default is true -
// Setting to false will stop collecting the user advertising & vendor ID.
soomlaConfig.validateVersions = false; // Default is true -
// Setting to false will disable alerting popup of invalid connector.
soomlaConfig.sendAttributionData = false; // Default is true -
// Setting to false will disable the ability to determine traffic source of the user install.
soomlaConfig.userId = "unique-userid-per-user";// Default user id is the user advertising id -
// The only allowed characters for user id are: letters, numbers, -, _ and /.
soomlaConfig.testMode = false; // Default is false -
// Set to true only to test your SOOMLA integration
// on the live event log on your SOOMLA acount Dashboard.
SoomlaTraceback.instance.initializeWithSoomlaConfig(appKey, soomlaConfig);
Warning: When setting the “
collectAdvertisingId
” to false, you must use the “userId
” with a unique user id.
User Consent Status (GDPR)
The function below gives you the ability to tell SOOMLA about the user's consent status. Use this function so that SOOMLA can identify consent status in exports and other server side reports that may be requested by you.
Note: the consent status should be set in every run of your App.
SoomlaTraceback.instance.setUserConsent(false); // Default is true.
Tagging Users
In order to make it easier to analyze user behavior and divide users into cohorts, it's possible to attach tags to users.
SoomlaTraceback.instance.addTags(['tag1', 'tag2']);
SoomlaTraceback.instance.removeTags(['tag1', 'tag2']);
Limitations for tags:
- Special Characters: The only allowed characters are: letters, numbers, -, _ and /.
- Number of Tags: There's a limit of 200 tags per App so make sure you're tagging your users smartly.
- Length of Tags: Tags cannot be longer than 50 characters. Tags that are too long will be ignored.
Change User ID
This will change the user id and start a new session.
SoomlaTraceback.instance.changeUserId(userId);
Add Extra User Id
After using this function user will have two ids.
SoomlaTraceback.instance.addExtraUserId(userId);