Get actionable, trackable data instantly to drive better decisions and performance.
Analytics events are structured data objects that get automatically triggered when significant actions or states occur within the drop-in. These allow you to monitor every aspect of the payment journey.
Analytics events allow you to:
- Gain transparency with native transaction tracking in PXP reports.
- Optimise conversion rates and reduce drop-offs, thanks to actionable insights.
- Feed real-time data into your analytics and CRM systems.
Analytics events should be consumed in the analyticsEvent callback when initialising Drop-in.
For example:
import com.pxp.checkout.checkoutdropin.CheckoutDropIn
import com.pxp.checkout.checkoutdropin.types.CheckoutDropInConfig
import com.pxp.checkout.analytics.BaseAnalyticsEvent
val checkoutDropIn = CheckoutDropIn.initialize(
context = context,
config = CheckoutDropInConfig(
environment = Environment.TEST,
session = sessionData,
ownerType = "MerchantGroup",
ownerId = "MERCHANT-1",
transactionData = DropInTransactionData(
amount = 99.99,
currency = "USD",
entryType = EntryType.Ecom,
intent = DropInTransactionIntentData(
card = IntentType.Authorisation,
paypalDropInIntent = DropInPayPalIntentType.Authorisation
),
merchant = "MERCHANT-1",
merchantTransactionId = UUID.randomUUID().toString(),
merchantTransactionDate = { Instant.now().toString() }
),
onGetShopper = {
Shopper(id = "shopper-001")
},
analyticsEvent = { event: BaseAnalyticsEvent ->
Log.d("Analytics", "Event: ${event.eventName}")
// Send to your analytics platform
sendToAnalyticsPlatform(event)
},
onSuccess = { result ->
verifyPaymentOnBackend(result)
},
onError = { error ->
Log.e("Checkout", "Payment failed: ${error.message}")
}
)
)Each analytics event contains the following base properties:
| Property | Description |
|---|---|
eventNameString | The name of the analytics event (e.g., "payment_method_selected", "payment_submitted"). |
sessionIdString | The session ID for the current checkout session. |
timestampString | When the event occurred, in ISO 8601 format. |
propertiesMap<String, Any>? | Additional event-specific properties (varies by event type). |
The drop-in automatically triggers the following events during the payment journey:
| Event name | Description |
|---|---|
drop_in_initialized | Fired when the drop-in is successfully initialised. |
drop_in_rendered | Fired when the drop-in UI is rendered on screen. |
payment_method_displayed | Fired when a payment method is displayed to the customer. |
payment_method_selected | Fired when the customer selects a payment method. |
payment_details_entered | Fired when the customer completes entering payment details. |
payment_submitted | Fired when the customer submits the payment. |
payment_processing | Fired when payment processing begins. |
payment_succeeded | Fired when the payment completes successfully. |
payment_failed | Fired when the payment fails. |
payment_cancelled | Fired when the customer cancels the payment. |
three_d_secure_started | Fired when 3D Secure authentication begins. |
three_d_secure_completed | Fired when 3D Secure authentication completes. |
validation_error | Fired when field validation fails. |
sdk_error | Fired when an SDK error occurs. |