TMBEventParams

@interface TMBEventParams : NSObject <TMBObjectEncodable>

Representation of a user-item interaction event. You can create event params to track events as users interact with items in your app. Novel users and items are automatically created. - see: https://tamber.com/docs/api/#event-track

  • Initialize user event with an item and behavior (TMBClient uses default user when tracking event).

    Declaration

    Objective-C

    + (nullable instancetype)eventWithItem:(nonnull id)item
                                  behavior:(nonnull NSString *)behavior;

    Swift

    class func event(withItem item: Any, behavior: String) -> Self?
  • Initialize user event with an item, behavior, and context (TMBClient uses default user when tracking event).

    Declaration

    Objective-C

    + (nullable instancetype)eventWithItem:(nonnull id)item
                                  behavior:(nonnull NSString *)behavior
                                   context:(nullable NSDictionary *)context;

    Swift

    class func event(withItem item: Any, behavior: String, context: [AnyHashable : Any]?) -> Self?
  • Initialize user event with an item, behavior, amount, and context (TMBClient uses default user when tracking event).

    Declaration

    Objective-C

    + (nullable instancetype)eventWithItem:(nonnull id)item
                                  behavior:(nonnull NSString *)behavior
                                    amount:(nullable NSNumber *)amount
                                   context:(nullable NSDictionary *)context;

    Swift

    class func event(withItem item: Any, behavior: String, amount: NSNumber?, context: [AnyHashable : Any]?) -> Self?
  • Initialize user event with an item, behavior, hit boolean, and context array (TMBClient uses default user when tracking event).

    Declaration

    Objective-C

    + (nullable instancetype)eventWithItem:(nonnull id)item
                                  behavior:(nonnull NSString *)behavior
                                       hit:(BOOL)hit
                                   context:(nullable NSDictionary *)context;

    Swift

    class func event(withItem item: Any, behavior: String, hit: Bool, context: [AnyHashable : Any]?) -> Self?
  • Initialize user event with an item, behavior, amount, and created time (TMBClient uses default user when tracking event).

    Declaration

    Objective-C

    + (nullable instancetype)eventWithItem:(nonnull id)item
                                  behavior:(nonnull NSString *)behavior
                                    amount:(nullable NSNumber *)amount
                                   created:(nullable NSDate *)created;

    Swift

    class func event(withItem item: Any, behavior: String, amount: NSNumber?, created: Date?) -> Self?
  • Initialize an event with a user, item and behavior.

    Declaration

    Objective-C

    + (nullable instancetype)eventWithUser:(nonnull NSString *)user
                                      item:(nonnull id)item
                                  behavior:(nonnull NSString *)behavior;

    Swift

    class func event(withUser user: String, item: Any, behavior: String) -> Self?
  • Initialize an event with a user, item, behavior, amount, and created time.

    Declaration

    Objective-C

    + (nullable instancetype)eventWithUser:(nonnull NSString *)user
                                      item:(nonnull id)item
                                  behavior:(nonnull NSString *)behavior
                                    amount:(nullable NSNumber *)amount
                                   created:(nullable NSDate *)created;

    Swift

    class func event(withUser user: String, item: Any, behavior: String, amount: NSNumber?, created: Date?) -> Self?
  • Initialize an event with a user, item, behavior, hit, and context.

    Declaration

    Objective-C

    + (nullable instancetype)eventWithUser:(nonnull NSString *)user
                                      item:(nonnull id)item
                                  behavior:(nonnull NSString *)behavior
                                       hit:(BOOL)hit
                                   context:(nullable NSDictionary *)context;

    Swift

    class func event(withUser user: String, item: Any, behavior: String, hit: Bool, context: [AnyHashable : Any]?) -> Self?
  • Initialize the full event params with a user, item, behavior, amount, and created time.

    Declaration

    Objective-C

    + (nullable instancetype)eventWithUser:(nonnull NSString *)user
                                      item:(nonnull id)item
                                  behavior:(nonnull NSString *)behavior
                                    amount:(nullable NSNumber *)amount
                                       hit:(BOOL)hit
                                   context:(nullable NSDictionary *)context
                                   created:(nullable NSDate *)created;

    Swift

    class func event(withUser user: String, item: Any, behavior: String, amount: NSNumber?, hit: Bool, context: [AnyHashable : Any]?, created: Date?) -> Self?
  • Initialize a session started item-less event.

    Declaration

    Objective-C

    + (nullable instancetype)sessionStarted;

    Swift

    class func sessionStarted() -> Self?
  • Initialize a session ended item-less event.

    Declaration

    Objective-C

    + (nullable instancetype)sessionEnded;

    Swift

    class func sessionEnded() -> Self?
  • Initialize a push rendered item-less event.

    Declaration

    Objective-C

    + (nullable instancetype)pushRendered;

    Swift

    class func pushRendered() -> Self?
  • Initialize a push received item-less event.

    Declaration

    Objective-C

    + (nullable instancetype)pushReceived;

    Swift

    class func pushReceived() -> Self?
  • Initialize a push engaged item-less event.

    Declaration

    Objective-C

    + (nullable instancetype)pushEngaged;

    Swift

    class func pushEngaged() -> Self?
  • User associated with the event.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *user;

    Swift

    var user: String? { get set }
  • Item associated with the event.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) id item;

    Swift

    var item: Any? { get set }
  • The behavior name.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *behavior;

    Swift

    var behavior: String? { get set }
  • Represents the amount that the behavior was performed. Defaults to 1.0 if not supplied.

    Declaration

    Objective-C

    @property (nonatomic, nullable) NSNumber *amount;

    Swift

    var amount: NSNumber? { get set }
  • hit

    Indicates that the event represents a successful recommendation (ex. user ‘clicks’ an item in their recommended items list). This is used in Tamber’s analytics tools to track how recommendations impact user behavior.

    Declaration

    Objective-C

    @property (nonatomic) BOOL hit;

    Swift

    var hit: Bool { get set }
  • The context(s) in which the event occurred. Useful for segmenting events data to determine the impact of interface elements and other contextual variables on user behavior. Also useful for A/B testing interface changes.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSDictionary *context;

    Swift

    var context: [AnyHashable : Any]? { get set }
  • Time the event occurred. Defaults to the current time if not supplied.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSDate *created;

    Swift

    var created: Date? { get set }
  • If you would like to instantly return new recommendations for the user, set getRecs (accepts number, page, and filter params). Note that all fields are optional, and adding a non NULL TMBDiscoverParams instance will return recommendations.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) TMBDiscoverParams *getRecs;

    Swift

    @NSCopying var getRecs: TMBDiscoverParams? { get set }