Skip to content

Tagging

  • Tagging customer's unique ID
[StreetHawk tagCuid:@"<USER_UNIQUE_ID>"];

Swift code:

SHApp.sharedInstance().tagCuid("<USER_UNIQUE_ID>")
  • Tagging user's email address

NSString *key = @"sh_email";
NSString *string_value = @"hello@streethawk.com";
[StreetHawk tagString:string_value forKey:key];
Swift code:

let key = "sh_email"
let string_value = "hello@streethawk.com"
SHApp.sharedInstance().tagString(string_value, forKey: key)
  • Tagging user first name
NSString *key = @"sh_first_name";
NSString *string_value = @"David";
[StreetHawk tagString:string_value forKey:key];

Swift code:

let key = "sh_first_name"
let string_value = "David"
SHApp.sharedInstance().tagString(string_value, forKey: key)
  • String value
NSString *key = @"ProductOffer";
NSString *string_value = @"Liked";
[StreetHawk tagString:string_value forKey:key];

Swift Code:

        let key = "ProductOffer"
        let string_value = "Liked"
        SHApp.sharedInstance().tagString(string_value, forKey: key)
  • Numeric value

NSString *key = @"BidValue";
NSInteger numeric_value = 549;
[StreetHawk tagNumeric:numeric_value forKey:key];
Swift Code:

        let key = "BidValue"
        SHApp.sharedInstance().tagNumeric(549, forKey: key)
  • Tag DateTime value
// Tagging using custom tag
NSString *key = @"Birthday";
NSDate *datetime_value = [NSDate date];
[StreetHawk tagDatetime:datetime_value forKey:key]; // string Date time value in UTC

Swift Code:

        // Tagging using custom tag
        let key = "Birthday"
        let datetime_value = NSDate()
        SHApp.sharedInstance().tagDatetime(datetime_value, forKey: key) // string Date time value in UTC
  • Increment Tag Value
NSString *key = @"PageVisited";
[StreetHawk incrementTag:key];

Swift Code

        let key = "PageVisited"
        SHApp.sharedInstance().incrementTag(key)
  • Remove Tag
NSString *key = @"RemoveUser";
[StreetHawk removeTag:key];

Swift Code:

        let key = "RemoveUser"
        SHApp.sharedInstance().removeTag(key)