Skip to main content

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 NameDescription
AppLaunchwhen the app first launches
ViewProductwhen a user views the details of a specific product
PurchaseProductwhen the user purchases a product

Request#

Parameter NameType
eventUserEvent
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 caseRecomanded params to pass
In case of user normaly view or purchase a productUserEvent.init(productId: <String?>, userEventType: <UserEventType>)
In case of user view the products over an OfferWallUserEvent.init(offeringId: <String?>, userEventType: <UserEventType>)
In case of user purcahse a product over an OfferWallUserEvent.init(productId: <String?>, offeringId: <String?>, userEventType: <UserEventType>)

Response#

Parameter NameType
saveSuccess[String]
errorGenericError?
 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)")                }            }}