Analytics
Get actionable, trackable data instantly to drive better decisions and performance.
Overview
Analytics events are structured data objects that get automatically triggered when significant actions or states occur within components. 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.
Consume an event
Analytics events should be consumed in the PxpCheckout.initialize
function. For example:
const pxpCheckoutSdk = PxpCheckout.initialize({
environment: "test",
session: sessionData,
merchantShopperId: '123',
ownerId: "UnityGroup",
ownerType: "MerchantGroup",
transactionData: {
currency: 'USD' as CurrencyType,
amount: payAmount,
entryType: "Ecom",
intent: "Authorisation",
merchantTransactionId: "9af8af33-59d5-432d-bd35-96124930ec9f",
merchantTransactionDate: () => new Date().toISOString(),
},
analyticsEvent: (analyticsEvent: AnalyticsEvent.BaseAnalyticsEvent) => {
if (analyticsEvent instanceof ClickOncePaymentCompletionTimeAnalyticsEvent) {
const completionTime = analyticsEvent.duration;
if (completionTime > 5000) { // Alert if over 5s
alertPerformanceTeam(analyticsEvent);
}
}
}
});
Supported events
The following table lists all the available events and describes the structure of each event.
Event name | Structure |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Event data
The following table describes the different types of data that can be returned by 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 ). |
componentId | The component's unique identifier. |
componentType | The component type (e.g., NewCard ). |
duration | The total time taken to complete a payment or fill in a CVV. |
editedFields | The fields that were edited. |
elementId | The element's unique identifier. |
endTimestamp | The date and time when the customer starts the payment process. |
errorCode | The error code. |
errorMessage | The description of the error. |
eventName | The name of the event. |
eventType | The type of lifecycle event (e.g., mount or unmount). |
formId | The form's unique identifier. |
interactionType | The type of interaction (e.g., Focus ). |
messageContent | The content of the message. |
operatingSystem | The operating system. |
pageUrl | The URL of the page that the event occurred on. |
sessionId | The session's unique identifier. |
startTimestamp | The date and time when the customer completes the payment process. |
timestamp | The date and time when the event occurred. |
Updated 3 days ago