User Segmentation

Contents

User Variables

To identify users, set values based on the Ad Rules dashboard configuration in your app, these values can be set/modified/removed at any time (even before initialisation) and will be used when attempting to load any ad type.

Supported data types: NSString, NSInteger, BOOL

Set User Data

Pass in a key (String) and the value to use.

Objective-C
Swift
[Tapdaq.sharedSession.properties setUserDataBool:YES forKey:@"paying_user"];
[Tapdaq.sharedSession.properties setUserDataString:@"A" forKey:@"group"];
[Tapdaq.sharedSession.properties setUserDataInteger:21 forKey:@"age"];

Remove User Data

Pass in the key, the key/value will be removed if it exists.

Objective-C
Swift
[Tapdaq.sharedSession.properties removeUserDataForKey:@"group"];

Get User Data

Data can be fetched by key or returned in a map with key(NSString), value(id). When fetching by key the return value will be an object, check its type before use. There are also methods to get values of the specific type.

Objective-C
Swift
TDProperties *properties = Tapdaq.sharedSession.properties;
id object = [properties userDataObjectForKey:@"group"];
NSString *group = [properties userDataStringForKey:@"group"];
NSInteger age = [properties userDataIntegerForKey:@"age"];
BOOL isPayingUser = [properties userDataBooleanForKey:@"paying_user"];
NSDictionary *userData = properties.userData;

Note: If integer or boolean user data is fetched using -userDataObjectForKey: the value will be returned as NSNumber.

Need help?

If you are having any problems integrating, feel free to contact us on [email protected] and we will be more than happy to help.