UI events
Purchasley controls a part of your UI and flows but we offer you the ability to track everything that the user is doing within our flows.
Every front end event is available through the
eventDelegate
/eventListener
Event name | Description | iOS value | Android value |
---|---|---|---|
Event Name | Description | iOS value | Android Value |
DEEPLINK_OPENED | The user opened a deeplink | .deeplinkOpened | DeepLinkOpened |
PRESENTATION_VIEWED | The presentation was opened | .presentationViewed | PresentationViewed |
PRESENTATION_CLOSED | The presentation was closed | .presentationClosed | PresentationClosed |
LOGIN_TAPPED | The user tapped on the login button | .loginTapped | LoginTapped |
RESTORE_TAPPED | The user has tapped on the restore button | .restoreTapped | RestoreTapped |
PROMO_CODE_TAPPED | The user has tapped on the promo code button | .promoCodeTapped | PromoCodeTapped |
LINK_OPENED | The user tapped a link (Terms and conditions, …) | .linkOpened | LinkOpened |
PLAN_SELECTED | The user selected a plan in the presentation | .planSelected | PlanSelected |
PURCHASE_TAPPED | The user tapped on purchase | .purchaseTapped | PurchaseTapped |
PURCHASE_CANCELLED | The user cancelled the purchase action | .purchaseCancelled | PurchaseCancelled |
CAROUSEL_SLIDE_SWIPED | The user has swipe on the carousel to see the next slide. | .carouselSlideSwiped | CarouselSlideSwiped |
PRESENTATION_OPENED | The user tapped to open another presentation (FLOWS) | .presentationOpened | PresentationOpened |
PRESENTATION_SELECTED | The user selected a presentation in the current presentation (FLOWS) | .presentationSelected | PresentationSelected |
PRESENTATION_LOADED | The presentation was loaded and is ready to be displayed | .presentationLoaded | PresentationLoaded |
Event name | Description | iOS value | Android value |
---|---|---|---|
Event Name | Description | iOS value | Android Value |
IN_APP_PURCHASING | The purchase started | .inAppPurchasing | InAppPurchasing |
IN_APP_PURCHASED | The purchased succeeded | .inAppPurchased | InAppPurchased |
IN_APP_PURCHASE_FAILED | The purchase failed | .inAppPurchaseFailed | InAppPurchaseFailed |
IN_APP_DEFERRED | The user started a deferred payment (i.e. Ask to buy, PSD2 approval) | .inAppDeferred | InAppDeferred |
IN_APP_NOT_AVAILABLE | The in-app purchase is not available to purchase. | n/a | InAppNotAvailable |
PURCHASE_CANCELLED_BY_APP | The app cancelled the purchase process | .purchaseCancelledByApp | PurchaseCancelledByApp |
Event name | Description | iOS value | Android value |
---|---|---|---|
Event Name | Description | iOS value | Android Value |
APP_INSTALLED | First installation of the SDK | .appInstalled | AppInstalled |
APP_CONFIGURED | The SDK is ready to make purchases | .appConfigured | AppConfigured |
APP_STARTED | The app was launched | .appStarted | AppStarted |
APP_UPDATED | The application version changed since last launch | .appUpdated | AppUpdated |
STORE_PRODUCT
_FETCH_FAILED | The Purchasely SDK couldn't fetch the product from the store | .productFetchError | ProductFetchError |
Event | Description | iOS value | Android value |
---|---|---|---|
RECEIPT_CREATED | The purchase was registered at Purchasely | .receiptCreated | ReceiptCreated |
RECEIPT_FAILED | The purchase was rejected | .receiptFailed | ReceiptFailed |
RECEIPT_VALIDATED | The purchase was validated | .receiptValidated | ReceiptValidated |
Event name | Description | iOS value | Android value |
---|---|---|---|
Event Name | Description | iOS value | Android Value |
IN_APP_RESTORED | The user restored its purchases after attempting to purchase a product he already owned | .inAppRestored | InAppRestored |
RESTORE_FAILED | The restoration failed | .restoreFailed | RestoreFailed |
RESTORE_STARTED | The restoration started | .restoreStarted | RestoreStarted |
RESTORE_SUCCEEDED | The restoration succeeded | .restoreSucceeded | RestoreSucceeded |
| | | |
Event name | Description | iOS value | Android value |
---|---|---|---|
Event Name | Description | iOS value | Android Value |
SUBSCRIPTIONS_TRANSFERRED | The anonymous user signed in and its subscriptions were transferred | .subscriptionsTransferred | SubscriptionsTransferred |
Event name | Description | iOS value | Android value |
---|---|---|---|
Event Name | Description | iOS value | Android Value |
USER_LOGGED_IN | A user logged in | .userLoggedIn | UserLoggedIn |
USER_LOGGED_OUT | A user logged out | .userLoggedOut | UserLoggedOut |
Event name | Description | iOS value | Android value |
---|---|---|---|
Event Name | Description | iOS value | Android Value |
CANCELLATION_REASON
_PUBLISHED | The user replied to the cancellation survey | .cancellationReasonPublished | CancellationReasonPublished |
Event Name | Description | iOS value | Android Value |
---|---|---|---|
SUBSCRIPTION_CANCEL_TAPPED | The user tapped Cancel subscription | .subscriptionCancelTapped | SubscriptionCancelTapped |
SUBSCRIPTION_DETAILS_VIEWED | Detail page of a subscription viewed | .subscriptionDetailsViewed | SubscriptionDetailsViewed |
SUBSCRIPTION_PLAN_TAPPED | Tapped to change plan | .subscriptionPlanTapped | SubscriptionPlanTapped |
SUBSCRIPTIONS_LIST_VIEWED | Subscriptions list viewed | .subscriptionsListViewed | SubscriptionListViewed |
PURCHASE_FROM
_STORE_TAPPED | The user opened the app from a Promoted In-App Purchase | .purchaseFromStoreTapped | n/a |
IN_APP_RENEWED | The subscription renewed (usually occurs on launch) | .inAppRenewed | n/a |
Purchasely tracks every action perfomed and you can insert these events into your own tracking system. To receive these events (
PLYEvent
) by setting yourself as a delegate (PLYEventDelegate/PLYEventListener
), after calling start
method:Swift
Objective-C
Kotlin
Java
React Native
Cordova
Purchasely.setEventDelegate(self)
[Purchasely setEventDelegate:self];
Purchasely.eventListener = eventListener
Purchasely.setEventListener(eventListener);
// Nothing special to setup, just go to "Receiving events" below
// Nothing special to setup, just go to "Receiving events" below
You will receive the events like this :
Swift
Objective-C
Kotlin
Java
React Native
Cordova
func eventTriggered(_ event: PLYEvent, properties: [String : Any]?) {
switch event {
case .linkOpened:
print("Link opened")
default:
print("Ignored")
}
}
- (void)eventTriggered:(enum PLYEvent)event properties:(NSDictionary<NSString *,id> * _Nullable)properties {
switch (event) {
case PLYEventLinkOpened:
NSLog(@"Link opened");
default:
NSLog(@"Ignored");
}
}
private val eventListener = object : io.purchasely.ext.EventListener {
override fun onEvent(event: PLYEvent) {
when (event) {
PLYEvent.LoginTapped -> Log.d("Purchasely", "Login tapped, we should open login page")
}
}
}
private EventListener eventListener = new EventListener() {
@Override
public void onEvent(@NotNull PLYEvent event) {
if(event instanceof PLYEvent.LoginTapped) {
Log.d("Purchasely", "Login tapped, we should open login page");
}
}
};
Purchasely.addEventListener((event) => {
console.log('Event Name ' + event.name);
console.log(event.properties);
console.log(event);
});
//When you do not want to listen to events anymore
Purchasely.removeEventListener();
Purchasely.addEventsListener((event) => {
console.log("Event Name " + event.name);
console.log(event.properties);
console.log(event);
});
Last modified 28d ago