Get actionable, trackable data instantly to drive better decisions and performance.
Analytics events are structured data objects that are automatically triggered when significant actions or states occur within Drop-in. Use them to monitor 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.
Set analyticsEvent on CheckoutDropInConfig when you call CheckoutDropIn.initialize(). The SDK invokes the callback whenever an analytics event is emitted during the checkout session (after create(), user interaction, and payment flow)—not only during initialize().
DeviceType is emitted from initialize() itself (via triggerAnalyticsEvents()). Component and Aeropay journey events also require create() and Content().
For example (with Aeropay enabled):
import android.util.Log
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Modifier
import com.pxp.checkout.analytics.BaseAnalyticsEvent
import com.pxp.checkout.checkoutdropin.CheckoutDropIn
import com.pxp.checkout.checkoutdropin.types.CheckoutDropInConfig
import com.pxp.checkout.exceptions.BaseSdkException
import com.pxp.checkout.models.CardIntentType
import com.pxp.checkout.models.DropInAeropayIntentType
import com.pxp.checkout.models.DropInPayPalIntentType
import com.pxp.checkout.models.DropInTransactionData
import com.pxp.checkout.models.DropInTransactionIntentData
import com.pxp.checkout.models.EntryType
import com.pxp.checkout.models.Environment
import com.pxp.checkout.models.SessionConfig
import com.pxp.checkout.services.models.transaction.Shopper
import java.time.Instant
import java.util.UUID
// sessionConfig from Sessions API (see Quickstart)
val sessionConfig: SessionConfig = fetchSessionFromBackend()
val checkoutDropIn = CheckoutDropIn.initialize(
context = context,
config = CheckoutDropInConfig(
environment = Environment.TEST,
session = sessionConfig,
ownerType = "MerchantGroup",
ownerId = "MERCHANT-1",
transactionData = DropInTransactionData(
amount = 99.99,
currency = "USD",
entryType = EntryType.Ecom,
intent = DropInTransactionIntentData(
card = CardIntentType.Authorisation,
paypalDropInIntent = DropInPayPalIntentType.Purchase,
aeropayDropInIntent = DropInAeropayIntentType.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} ts=${event.timestamp}")
// Send to your analytics platform (illustrative)
sendToAnalyticsPlatform(event)
},
onSuccess = { result ->
verifyPaymentOnBackend(result)
},
onError = { paymentMethod, error ->
Log.e(
"Checkout",
"Payment failed [${paymentMethod?.value}]: ${error.errorCode}: ${error.message}"
)
}
)
)
LaunchedEffect(checkoutDropIn) {
checkoutDropIn.create()
}
checkoutDropIn.Content(modifier = Modifier.fillMaxWidth())Aeropay requires aeropayDropInIntent, currency = "USD", entryType = EntryType.Ecom, and session allowedFundingTypes.payByBanks.aeropay. See Aeropay for full setup. Without aeropayDropInIntent, Aeropay journey analytics such as AerosyncLaunched and PreAuthorisation don't run.
BaseAnalyticsEvent defines the following base properties:
| Property | Type | Description |
|---|---|---|
eventNameString | The Android Drop-in event name (e.g., "ComponentInteraction", "PreAuthorisation", "AerosyncLaunched"). | |
sessionIdString | The session ID for the current checkout session. | |
timestampLong | When the event occurred, as milliseconds since epoch (default: System.currentTimeMillis()). Convert to ISO 8601 in your handler if needed. Gson serialises timestamp as a JSON number. |
There's no generic properties map on the base type. Event-specific fields live on concrete subclasses (e.g., device type, component type, or transaction ID). Prefer when (event) on those types, or serialize with AnalyticsGsonProvider.toJson(event), rather than assuming a shared property bag.
Drop-in emits Android eventName values from the checkout analytics package. Representative events:
| Event name | Description |
|---|---|
DeviceType | Fired during CheckoutDropIn.initialize() via triggerAnalyticsEvents(), not during create(). |
ComponentLifecycleEvent | Component mount or unmount (eventType: Mount or Unmount). Fired after create() / panel mount. |
ComponentInteraction | User interactions (clicks, field focus). |
ComponentError | SDK or component errors. |
CustomerClick | Pay button or launcher clicks. |
PreAuthorisation or PostAuthorisation | Payment lifecycle (card, Aeropay, Google Pay, and other methods that authorise through this path). Same eventName across methods — use componentType on the concrete event type (for example "aeropay") before attributing to a method. |
PreAuthentication or PostAuthentication | 3DS authentication steps. |
3ds_authentication_* or 3ds_challenge_* | 3DS challenge flow events. |
ErrorMessageShown | Inline validation or error messages shown to the shopper. |
authentication_failure | Authentication failures. |
GooglePayButtonClick | Google Pay button interaction. |
Wallet- or method-specific names also apply (e.g., button-click events).
When Aeropay is enabled and eligible, the same analyticsEvent handler receives Aeropay-specific and shared events during the popup flow (consumer data, OTP, Aerosync).
The following table maps the Aeropay journey to typical eventName values:
| Stage | Typical eventName values |
|---|---|
Drop-in initialize() | DeviceType |
After create() / panel visible | ComponentLifecycleEvent (Mount), further ComponentInteraction |
| Shopper opens Aeropay | CustomerClick or component interaction events |
| Consumer data, OTP, validation | ComponentInteraction, ComponentError, ErrorMessageShown |
| Bank linking (Aerosync) | AerosyncLaunched, then AerosyncCompleted or AerosyncFailed |
| Authorisation | PreAuthorisation, then PostAuthorisation on success |
eventName | When |
|---|---|
AerosyncLaunched | Aerosync widget opens. |
AerosyncCompleted | Aerosync completes successfully. |
AerosyncFailed | Aerosync ends in failure. |
PreAuthorisation | Authorisation starts. Shared across methods; Aeropay emits componentType = "aeropay" on the concrete event type. |
PostAuthorisation | Authorisation completes. Shared across methods; branch on componentType (or the concrete analytics type) before attributing to Aeropay. |
Example — attribute shared lifecycle names to Aeropay only when the component type matches:
import com.pxp.checkout.analytics.common.PostAuthorisationAnalyticsEvent
import com.pxp.checkout.analytics.common.PreAuthorisationAnalyticsEvent
analyticsEvent = { event ->
when (event) {
is PreAuthorisationAnalyticsEvent ->
if (event.componentType == "aeropay") track("aeropay_pre_auth")
is PostAuthorisationAnalyticsEvent ->
if (event.componentType == "aeropay") track("aeropay_post_auth")
else -> when (event.eventName) {
"AerosyncLaunched" -> track("aeropay_aerosync_started")
"AerosyncCompleted" -> track("aeropay_bank_linked")
"AerosyncFailed" -> track("aeropay_aerosync_failed")
"ComponentError" -> track("checkout_component_error", event)
else -> { }
}
}
}Shared events (ComponentInteraction, ComponentError, ComponentLifecycleEvent, ErrorMessageShown) also fire during consumer data and OTP steps.