Get actionable, trackable data instantly to drive better decisions and performance.
Analytics events are structured data objects that the SDK raises when significant actions or states occur in Payout Drop-in. Use them to monitor the withdrawal journey in your own analytics or CRM tools.
Analytics events allow you to:
- Observe Drop-in lifecycle and interaction events in your own tooling.
- Optimise conversion rates and reduce drop-offs with actionable insights.
- Feed real-time data into your analytics and CRM systems.
analyticsEvent is optional. Treat it as observational alongside onSuccess, onError, and your backend webhook handling for payout outcomes. Don't block the withdrawal UI waiting for analytics network calls.
Pass an analyticsEvent callback to PayoutDropIn.initialize. The SDK calls it with each event object. Use event.eventName to route payloads.
For example:
import {
PayoutDropIn,
type PayoutDropInSubmitResult,
} from '@pxpio/web-components-sdk';
import type { BaseSdkException } from '@pxpio/web-components-sdk';
const payoutDropIn = PayoutDropIn.initialize({
environment: 'test',
session: sessionData,
ownerId: 'MERCHANT-1',
transactionData: {
currency: 'USD',
amount: 25,
entryType: 'Ecom',
merchantTransactionId: 'withdrawal-123',
merchantTransactionDate: () => new Date().toISOString(),
},
onGetShopper: () => Promise.resolve({ id: 'shopper-001' }),
analyticsEvent: (event) => {
console.log('Analytics event:', event.eventName, event);
if (typeof gtag !== 'undefined') {
gtag('event', event.eventName, {
session_id: event.sessionId,
timestamp:
event.timestamp instanceof Date
? event.timestamp.toISOString()
: event.timestamp,
});
}
},
onSuccess: async (result: PayoutDropInSubmitResult) => {
await verifyPayoutOnBackend(result);
},
onError: (error: BaseSdkException) => {
console.error('Payout failed:', error);
},
});
await payoutDropIn.create('payout-drop-in-container');Every event includes at least:
eventName: The event identifier (e.g.,DeviceType).sessionId: The payout session identifier.timestamp: The date and time when the event was created.
The tables below list events the Web SDK can raise during a Payout Drop-in session. Exact events depend on which methods and user interface steps the shopper uses.
Raised once when you call PayoutDropIn.initialize.
| Event name | Structure |
|---|---|
DeviceType |
|
BrowserData |
|
Raised when Drop-in panels and nested components mount or unmount, and when component-level errors occur (including some SDK and Unity service failures surfaced through the shared analytics callback).
| Event name | Structure |
|---|---|
ComponentLifecycleEvent |
|
ComponentError |
|
eventType on ComponentLifecycleEvent is Mount or Unmount. errorCode on ComponentError can be omitted for some failures.
Card, Apple Pay, and Google Pay withdrawals use the stored-instrument list and withdraw submit components (useCardOnFile: true).
Raised from the stored-instrument list while the shopper selects, edits, deletes, or abandons a card.
| Event name | Structure |
|---|---|
ChangePreselectedCardClick |
|
CardDeletion |
|
EditCardClick |
|
ComponentAbandonment |
|
For stored-card abandonment, componentType is CardOnFile. The list has no CVC field, so CVVFillTime isn't raised.
Raised when the shopper confirms a card-on-file withdrawal.
| Event name | Structure |
|---|---|
CustomerClick |
|
ComponentInteraction |
|
PayButtonClick |
|
PreAuthorisation |
|
PostAuthorisation |
|
On this path, componentType is typically CardOnFile, and interactionType for the submit interaction is Submit. Soft-decline retries can set isRetry to true on PreAuthorisation and PostAuthorisation.
Payout intent skips tokenisation and 3D Secure authentication analytics (e.g., PreTokenization, PostTokenization, SecurityCheck, and the authentication lifecycle events).
When closed-loop enforcement is active, the closed-loop drop-in also raises ComponentLifecycleEvent and ComponentError. Preferred-method and excess-selection screens reuse the card-on-file list events above when a stored-instrument list is shown.
The PayPal panel raises ComponentLifecycleEvent and ComponentError for its UI. On submit it also raises:
| Event name | Structure |
|---|---|
CustomerClick |
|
ComponentInteraction |
|
For that submit interaction, componentType is Paypal and interactionType is Submit. Card-on-file submit events such as PayButtonClick, PreAuthorisation, and PostAuthorisation apply only to card, Apple Pay, and Google Pay.
The following table describes common fields returned on analytics events.
| Name | Description |
|---|---|
browserType | The browser type (e.g., Chrome). |
browserVersion | The browser version. |
cardBrand | The card brand (e.g., Visa or Mastercard). |
cardStatus | The state of the card (e.g., Expired). |
cardType | The card type reported for the selected instrument. |
componentId | The component's unique identifier. |
componentType | The component type (e.g., CardOnFile or Paypal). |
deviceType | The device category detected at initialisation. |
editedFields | The fields edited on a stored card (e.g., ExpiryDate). |
elementId | The element's unique identifier. |
errorCode | The SDK error code, when present. |
errorMessage | The error description. |
eventName | The name of the event. |
eventType | The lifecycle action (Mount or Unmount). |
interactionType | The interaction type (e.g., Submit or Click). |
isRetry | Whether the lifecycle step is a soft-decline retry. |
operatingSystem | The operating system. |
pageUrl | The page URL where the event occurred. |
sessionId | The session's unique identifier. |
timestamp | The date and time when the event occurred. |
transactionId | The transaction identifier associated with the lifecycle step. |