UI Analytics

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.

Listen to the events

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), either from the start method:

Swift
Objective-C
Kotlin
Java
React Native
Cordova
Swift
Purchasely.start(withAPIKey: "API_KEY", eventDelegate: self)
Objective-C
[Purchasely startWithAPIKey:@"API_KEY"
appUserId:@"USER_ID"
eventDelegate:self
uiDelegate:nil
logLevel: LogLevelInfo];
Kotlin
Purchasely.Builder(applicationContext)
.apiKey("API_KEY")
.eventListener(eventListener)
.stores(listOf(GoogleStore(), HuaweiStore(), AmazonStore()))
.build()
.start()
Java
new Purchasely.Builder(applicationContext)
.apiKey("API_KEY")
.eventListener(eventListener)
.stores(listOf(GoogleStore(), HuaweiStore(), AmazonStore()))
.build()
.start();
React Native
// Nothing special to setup, just go to "receive the events"
Cordova
// Nothing special to setup, just go to "receive the events"

or later

Swift
Objective-C
Kotlin
Java
React Native
Cordova
Swift
Purchasely.setEventDelegate(self)
Objective-C
[Purchasely setEventDelegate:self];
Kotlin
Purchasely.eventListener = eventListener
Java
Purchasely.setEventListener(eventListener);
React Native
// Nothing special to setup, just go to "receive the events"
Cordova
// Nothing special to setup, just go to "receive the events"

Then you will receive the events like this :

Swift
Objective-C
Kotlin
Java
React Native
Cordova
Swift
func eventTriggered(_ event: PLYEvent, properties: [String : Any]?) {
switch event {
case .linkOpened:
print("Link opened")
default:
print("Ignored")
}
}
Objective-C
- (void)eventTriggered:(enum PLYEvent)event properties:(NSDictionary<NSString *,id> * _Nullable)properties {
switch (event) {
case PLYEventLinkOpened:
NSLog(@"Link opened");
default:
NSLog(@"Ignored");
}
}
Kotlin
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")
}
}
}
Java
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");
}
}
};
React Native
Purchasely.addListener('PURCHASELY_EVENTS', (event) => {
console.log('Event Name ' + event.name);
console.log(event.properties);
console.log(event);
});
Cordova
Purchasely.addEventsListener((event) => {
console.log("Event Name " + event.name);
console.log(event.properties);
console.log(event);
});

Event list

Every front end event is available through the eventDelegate/eventListener

Event

Description

iOS value

Android value

APP_CONFIGURED

The SDK is ready to make purchases

.appConfigured

AppConfigured

APP_INSTALLED

First installation of the SDK

.appInstalled

AppInstalled

APP_STARTED

The app was launched

.appStarted

AppStarted

APP_UPDATED

The application version changed since last launch

.appUpdated

AppUpdated

DEEPLINK_OPENED

The user opened a deeplink

.deeplinkOpened

DeepLinkOpened

IN_APP_DEFERRED

The user started a deferred payment (i.e. Ask to buy)

.inAppDeferred

InAppDeferred

IN_APP_PURCHASE_FAILED

The purchase failed

.inAppPurchaseFailed

InAppPurchaseFailed

IN_APP_PURCHASED

The purchased succeeded

.inAppPurchased

InAppPurchased

IN_APP_PURCHASING

The purchase started

.inAppPurchasing

InAppPurchasing

IN_APP_RENEWED

The subscription renewed (usually occurs on launch)

.inAppRenewed

n/a

IN_APP_RESTORED

The user restored its purchases after attempting to purchase a product he already owned

.inAppRestored

InAppRestored

LINK_OPENED

The user tapped a link (Terms and conditions, …)

.linkOpened

LinkOpened

LOGIN_TAPPED

The user tapped on the login button

.loginTapped

LoginTapped

PLAN_SELECTED

The user selected a plan in the presentation

.planSelected

PlanSelected

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_VIEWED

The presentation was opened

.presentationViewed

PresentationViewed

PURCHASE_CANCELLED

The user cancelled the purchase action

.purchaseCancelled

PurchaseCancelled

PURCHASE_CANCELLED_BY_APP

The app cancelled the purchase process

.purchaseCancelledByApp

PurchaseCancelledByApp

PURCHASE_FROM _STORE_TAPPED

The user opened the app from a Promoted In-App Purchase

.purchaseFromStoreTapped

n/a

PURCHASE_TAPPED

The user tapped on purchase

.purchaseTapped

PurchaseTapped

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

RESTORE_FAILED

The restoration failed

.restoreFailed

RestoreFailed

RESTORE_STARTED

The restoration started

.restoreStarted

RestoreStarted

RESTORE_SUCCEEDED

The restoration succeeded

.restoreSucceeded

RestoreSucceeded

STORE_PRODUCT _FETCH_FAILED

Purchasely couldn't fetch the product from the store

.productFetchError

ProductFetchError

SUBSCRIPTIONS_TRANSFERRED

The anonymous user signed in and its subscriptions were transferred

.subscriptionsTransferred

SubscriptionsTransferred

USER_LOGGED_IN

A user logged in

.userLoggedIn

UserLoggedIn

USER_LOGGED_OUT

A user logged out

.userLoggedOut

UserLoggedOut

Some events are specific to the User subscriptions screen

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

CANCELLATION_REASON _PUBLISHED

The user replied to the cancellation survey

.cancellationReasonPublished

CancellationReasonPublished