In this document you will learn of the advanced SOOMLA SDK setup options:
- Special Initialization Configuration
- Tagging Users
- Change User ID
- Add Extra User Id
- SDK custom events
- 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.
SoomlaConfig *config = [SoomlaConfig config];
config.collectIdfa = NO; // Defult is YES -
// Setting to false will stop collecting the user advertising & vendor ID.
config.validateVersions = NO; // Defult is YES -
// Setting to NO will disable alerting popup of invalid connector.
config.sendAttributionData = No; // Defult is YES -
// Setting to NO will disable the ability to determen trafic source of the user install.
config.userId = @"unique-userid-per-user";// Up to v5.18.0 default user id is the user advertising id, from v5.18.0 the default user id is Soomla id.
// The only allowed characters for user id are: letters, numbers, @, -, _ and /.
// The uid cannot be null and must be between 2 and 100 chars, otherwise it will be blocked.
config.testMode = YES; // Defult is NO -
// Set to YES only to test your SOOMLA integration
config.logLevel = TB_LOG_LEVEL_INFO;
// Staring from Soomla SDK v5.10.0 - allow setting 5 different log levels
// ERROR, WARNING, INFO, DEBUG, VERBOSE
// Default is INFO
[[SoomlaTraceback getInstance] initializeWithAppKey:appKey andConfig:config];
collectIdfa
” to NO, you must use the “userId
” with a unique user id.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 getInstance] addTags:@[@"tag1", @"tag2"]];
[[SoomlaTraceback getInstance] 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 getInstance] changeUserId:userId];
Add Extra User Id
After using this function user will have two ids.
[[SoomlaTraceback getInstance] addExtraUserId:userId];
SDK custom events
This functionality allows users to send custom events and data from unsupported networks.
By that, you can send impressions, clicks, and video completions.
in order to use this feature, you need to fill the following fields:
- Ad network name (Integration name)
- ad-Type
- extra Fields (JSON)
[[SoomlaTraceback getInstance] onAdDisplayed:adNetwork withAdType:adType andExtraFields:extraFields];
[[SoomlaTraceback getInstance] onAdClicked:adNetwork withAdType:adType andExtraFields:extraFields];
[[SoomlaTraceback getInstance] onVideoCompleted:adNetwork withAdType:adType andExtraFields:extraFields];
[[SoomlaTraceback getInstance] onAdClosed:adNetwork withAdType:adType andExtraFields:extraFields];
SDK Call-Back events:
AdListener:
Allows publishers to get callbacks in the app whenever Soomla is sending an event (like the live events log, but programmatically). it's mostly used for testing
@interface EventsDelegate : NSObject<SoomlaTracebackDelegate>
@end
@implementation EventsDelegate
- (void)adDisplayedForAdNetwork:(NSString*)adNetwork andAdType:(TracebackAdType)adType {
NSLog(@"adDisplayedForAdNetwork %@ %d", adNetwork, adType);
}
- (void)adClosedForAdNetwork:(NSString*)adNetwork andAdType:(TracebackAdType)adType {
NSLog(@"adClosedForAdNetwork %@ %d", adNetwork, adType);
}
@end
self.eventsDelegate = [[EventsDelegate alloc] init];
[SoomlaTraceback getInstance].delegate = self.eventsDelegate;
Override User Country Code
User country code will be set as supplied by this function
[[SoomlaTraceback getInstance] overrideCountryCode:countryCode];