Set Appmate Events
When you want to track a user's activity while using the app use saveAppUserEvents method. Appmate allows you to pass three types of events:
Event Name | Description |
---|---|
AppLaunch | when the app first launches |
ViewProduct | when a user views the details of a specific product |
PurchaseProduct | when the user purchases a product |
#
RequestParameter Name | Type |
---|---|
event | UserEvent |
completion | (Bool, GenericError?) -> Void |
For more accurate reports, it's recommended to pass the parameters of the user event as described below.
User Event init case | Recomanded params to pass |
---|---|
In case of user normaly view or purchase a product | UserEvent.init(productId: <String?>, userEventType: <UserEventType>) |
In case of user view the products over an OfferWall | UserEvent.init(offeringId: <String?>, userEventType: <UserEventType>) |
In case of user purcahse a product over an OfferWall | UserEvent.init(productId: <String?>, offeringId: <String?>, userEventType: <UserEventType>) |
#
ResponseParameter Name | Type |
---|---|
saveSuccess | [String] |
error | GenericError? |
- Swift
- Objective-C
let event = UserEvent(productId: "<PRODUCT_ID>", userEventType: .PurchaseProduct) PurchaseClient.shared.saveAppUserEvents(event: event) { saveSuccess, error in if let error = error { print(error.description) } else { print("User event saved \(saveSuccess)") } }}
UserEvent * event = [[UserEvent alloc] initWithProductId:@"<PRODUCT_ID>" userEventType:UserEventTypePurchaseProduct] [[[PurchaseClient shared] saveAppUserEventsWithEvent:(event) completion:^(BOOL saveSuccess, GenericError * error) { if (error != nil) { NSLog(@"%@", error.description); } else { NSLog(@"%s, %d", "User event saved", saveSuccess); } }]