iOS User Tagging Example
You can tag users/devices from your SDK in one line of code.
The SDK looks after the details for the device, you just supply the tag key and
value:
- The tag name (key) is what you want to call it. In the example below "Plan-49"
is how you will see this in the Contextual Dashboard.
- Contextual supports tags of: string, numeric and datetime. In the example below,
the value for "Plan-49" is "Trial-Period".
Swift
| Pointzi.sharedInstance().tagString("Trial-Period", forKey: "Plan-49")
|
Objc
| [POINTZI tagString:@"Trial-Period" forKey:@"Plan-49"];
|
Swift
| Pointzi.sharedInstance().tagNumeric(549, forKey: ""BidValue"")
|
Objc
| [POINTZI tagNumeric:549 forKey:@"BidValue"];
|
Swift
| // Tagging using predefined POINTZI tag.
let key = "sh_registered"
let datetime_value = NSDate()
Pointzi.sharedInstance().tagDatetime(datetime_value, forKey: key)
// Tagging using custom tag
let key = "Birthday"
let datetime_value = NSDate()
Pointzi.sharedInstance().tagDatetime(datetime_value, forKey: key) // string Date time value in UTC
|
Objc
| // Tagging using predefined POINTZI tag.
NSString *key = @"sh_registered";
NSDate *datetime_value = [NSDate date];
[POINTZI tagDatetime:datetime_value forKey:key];
// Tagging using custom tag.
NSString *key = @"Birthday";
NSDate *datetime_value = [NSDate date];
[POINTZI tagDatetime:datetime_value forKey:key]; // string Date time value in UTC
|
Increment Tag Value
Swift
| let key = "PageVisited"
Pointzi.sharedInstance().incrementTag(key)
|
Objc
| NSString *key = @"PageVisited";
[POINTZI incrementTag:key];
|
Remove Tag
Swift
| let key = "RemoveUser"
Pointzi.sharedInstance().removeTag(key)
|
Objc
| NSString *key = @"RemoveUser";
[POINTZI removeTag:key];
|
Last update:
2024-01-14