Purchasely
2.8
2.8
  • Welcome page
  • General
    • Presentation
  • Quick test
    • Test in 5 minutes
  • Basic configuration
    • Console Configuration
      • Creating a new application
      • Creating your Products
        • App Store
        • Play Store
        • Huawei App Gallery
        • Amazon App Store
        • Products & Plans
      • Design your Paywalls
    • SDK installation
      • iOS SDK
      • Android SDK
      • React Native SDK
      • Cordova SDK
    • SDK configuration
    • Webhook
      • Receiving and understanding messages
      • Managing entitlements
      • Subscription events
      • Events attributes
      • Detailed sequence diagrams
    • Observer mode
  • Dashboards
    • Introduction
    • Live
    • Subscriptions
    • Cohorts
    • Trials
    • Events
  • S2S notifications
    • Server-to-server notifications ?
    • App Store
    • Play Store
    • Huawei App Gallery
    • Amazon App Store
  • Integrations
    • Airship
    • Amplitude
    • Braze
    • Firebase
  • Advanced Features
    • Anonymous user
    • Associating content
    • Customising UI
      • Errors & alerts
      • Controllers (iOS) / Fragments (Android)
    • Deeplinks automations
    • Displaying users subscriptions
    • UI Analytics
    • Localization
    • Non-subscription products
    • Promoting your products
      • Self-promotion
      • Promoting In-App Purchases
    • Purchase interceptor
    • Purchase manually
    • Subscription status
    • Paywall Guidelines
  • Others
    • Frequently Asked Questions
    • Migration guides
      • Migrate to Purchasely
      • SDK
        • v2.1.3
        • v2.2.0
      • Webhooks
        • v3.0
  • TESTING
    • Testing Cycle Durations
Powered by GitBook

© Purchasely 2020-2023

On this page
  • Listen to the events
  • Event list

Was this helpful?

  1. Advanced Features

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:

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

or later

 Purchasely.setEventDelegate(self)
[Purchasely setEventDelegate:self];
Purchasely.eventListener = eventListener
Purchasely.setEventListener(eventListener);
// Nothing special to setup, just go to "receive the events"
// Nothing special to setup, just go to "receive the events"

Then you will receive the events like this :

	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);
});

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

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

PreviousDisplaying users subscriptionsNextLocalization

Last updated 3 years ago

Was this helpful?

Some events are specific to the

User subscriptions screen