{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["sub-heading","admonition"]},"type":"markdown"},"seo":{"title":"Analytics","description":"Transform your commerce with PXP's unified platform—seamless payments, real-time insights, and global growth in one powerful integration.","lang":"en-UK","siteUrl":"https://developer.pxp.io","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"analytics","__idx":0},"children":["Analytics"]},{"$$mdtype":"Tag","name":"SubHeading","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Get actionable, trackable data instantly to drive better decisions and performance."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"overview","__idx":1},"children":["Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Analytics events are structured data objects automatically triggered when significant actions or states occur during a Paze payment. Configure a single handler on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CheckoutConfig"]}," to monitor every stage of the payment journey."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Analytics events allow you to:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Gain transparency with native transaction tracking in PXP reports."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Optimise conversion rates and reduce drop-offs, thanks to actionable insights."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Feed real-time data into your analytics and CRM systems."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"consume-an-event","__idx":2},"children":["Consume an event"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Analytics events are delivered through the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["analyticsEvent"]}," callback on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CheckoutConfig"]}," when you initialise ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PxpCheckout"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"let checkoutConfig = CheckoutConfig(\n    environment: .test,\n    session: sessionData,\n    transactionData: transactionData,\n    merchantShopperId: \"shopper-123\",\n    ownerId: \"MERCHANT-GROUP-1\",\n    clientName: \"Your Merchant\",\n    siteName: \"Your Store\",\n    onGetShopper: { async in\n        TransactionShopper(id: \"shopper-123\", email: \"customer@example.com\")\n    },\n    analyticsEvent: { event in\n        if let clickEvent = event as? PazeButtonClickAnalyticsEvent {\n            print(\"Paze button clicked\", clickEvent.componentId, clickEvent.merchantTransactionId)\n        }\n\n        if let checkoutComplete = event as? PazeCheckoutCompletedAnalyticsEvent {\n            print(\"Paze checkout completed\", checkoutComplete.merchantTransactionId)\n        }\n\n        if let authFailed = event as? PazeAuthorisationFailedAnalyticsEvent {\n            print(\"Paze authorisation failed\", String(describing: authFailed.additionalData))\n        }\n    }\n)\n\nlet pxpCheckout = try PxpCheckout.initialize(config: checkoutConfig)\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To handle all Paze-specific events with one branch, cast to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeAnalyticsEvent"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"analyticsEvent: { event in\n    if let pazeEvent = event as? PazeAnalyticsEvent {\n        trackPazeEvent(\n            name: pazeEvent.eventName,\n            sessionId: pazeEvent.sessionId,\n            componentId: pazeEvent.componentId,\n            merchantTransactionId: pazeEvent.merchantTransactionId,\n            additionalData: pazeEvent.additionalData\n        )\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Button visibility isn't emitted as a dedicated analytics event. Instead, track presentment with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPresentmentResolved"]}," on the Paze button component:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onPresentmentResolved = { isVisible in\n    trackMetric(\"paze_button_visible\", properties: [\"isVisible\": isVisible])\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"supported-events","__idx":3},"children":["Supported events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following tables list events you can receive during a Paze payment. Paze-specific events extend ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeAnalyticsEvent"]},". Shared lifecycle events use different structures, so check ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]}," when filtering."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"paze-specific-events","__idx":4},"children":["Paze-specific events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Events that extend ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeAnalyticsEvent"]},":"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Event name"},"children":["Event name"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Swift type"},"children":["Swift type"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Structure"},"children":["Structure"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeButtonRendered"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeButtonRenderedAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["walletType"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeButtonClicked"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeButtonClickAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["walletType"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazePopupLaunched"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazePopupLaunchedAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["walletType"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeCheckoutCompleted"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeCheckoutCompletedAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["walletType"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeCheckoutAbandoned"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeCheckoutAbandonedAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["walletType"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["additionalData"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeDecryptionInitiated"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeDecryptionInitiatedAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["walletType"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeDecryptionCompleted"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeDecryptionCompletedAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["walletType"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeDecryptionFailed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeDecryptionFailedAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["walletType"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["additionalData"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeAuthorisationFailed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeAuthorisationFailedAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["walletType"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["additionalData"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeSdkInitialisationFailed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeSdkInitialisationFailedAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["walletType"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["additionalData"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeCheckoutFailed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeCheckoutFailedAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["walletType"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["additionalData"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeCompleteFailed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeCompleteFailedAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["walletType"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["additionalData"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"shared-lifecycle-events-during-paze-payments","__idx":5},"children":["Shared lifecycle events during Paze payments"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["These events don't extend ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeAnalyticsEvent"]},":"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Event name"},"children":["Event name"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Swift type"},"children":["Swift type"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Structure"},"children":["Structure"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PreAuthorisation"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PreAuthorisationAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["isRetry"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PostAuthorisation"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PostAuthorisationAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["isRetry"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeTransactionInitiated"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaymentLifecycleAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionId"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeAuthorisationCancelled"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaymentLifecycleAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionId"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeTokenDecryptionCancelled"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaymentLifecycleAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionId"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentError"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentErrorAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errorCode"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errorMessage"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PreAuthorisation"]}," is emitted only when you configure ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]}," and the flow proceeds (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".proceed"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".transactionInitData"]},"). Returning ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".cancel"]}," emits ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeAuthorisationCancelled"]}," instead. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PostAuthorisation"]}," is emitted when you configure ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostAuthorisation"]}," and the SDK receives a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MerchantSubmitResult"]},", immediately before your callback runs. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeAuthorisationFailed"]}," may also fire if the response reports an error state. Paze doesn't emit 3DS or tokenisation events such as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PreAuthentication"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PreTokenization"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"event-data","__idx":6},"children":["Event data"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All Paze analytics events extend ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeAnalyticsEvent"]}," and include:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Name"},"children":["Name"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The name of the event (for example, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeButtonClicked"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The date and time when the event occurred."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The session's unique identifier."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The Paze button component's unique identifier."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The merchant transaction identifier from SDK initialisation."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["walletType"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Always ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Paze"]}," for Paze-specific events."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["additionalData"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Present on all ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeAnalyticsEvent"]}," types. Populated on failure and abandonment events with error details, checkout ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["reason"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FailedSubmitResult"]},". Otherwise empty."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Shared lifecycle events add:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Name"},"children":["Name"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"paze-button\""]}," for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PreAuthorisation"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PostAuthorisation"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeTransactionInitiated"]},", and cancellation events."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The merchant transaction identifier on lifecycle events."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["isRetry"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Whether the lifecycle event is a retry (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PreAuthorisation"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PostAuthorisation"]}," only)."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"when-each-event-fires","__idx":7},"children":["When each event fires"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Event name"},"children":["Event name"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Trigger"},"children":["Trigger"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeButtonRendered"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Presentment validation succeeds and the button becomes visible."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeButtonClicked"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Checkout-time validation passes after the shopper taps the button, before the Paze web session opens."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazePopupLaunched"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The Paze web checkout session opens in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ASWebAuthenticationSession"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeCheckoutCompleted"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Paze checkout returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["COMPLETE"]}," and merchant approves at ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCheckoutComplete"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeCheckoutAbandoned"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Checkout is incomplete, the shopper cancels, or merchant validation rejects checkout."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeDecryptionInitiated"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The SDK begins decrypting the secured payload."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeDecryptionCompleted"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Decryption succeeds."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeDecryptionFailed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Decryption fails."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeCompleteFailed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The complete API call fails."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeCheckoutFailed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The checkout flow fails with an error."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeAuthorisationFailed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Transaction submission fails."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeSdkInitialisationFailed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Presentment validation fails (button hidden)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeTokenDecryptionCancelled"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreDecryption"]}," returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeAuthorisationCancelled"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]}," returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".cancel"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeTransactionInitiated"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Authorisation request is sent to the Unity API."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PreAuthorisation"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]}," is configured and the flow proceeds (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".proceed"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".transactionInitData"]},"). Returning ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".cancel"]}," emits ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeAuthorisationCancelled"]}," instead. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"paze-button\""]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PostAuthorisation"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostAuthorisation"]}," is configured and the SDK receives a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MerchantSubmitResult"]},", immediately before your callback runs. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"paze-button\""]},". ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeAuthorisationFailed"]}," may also fire if the response reports an error state."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentError"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Component validation fails (for example, invalid Kount risk screening data)."]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPazeButtonClicked"]}," fires when the shopper taps the button. The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeButtonClicked"]}," analytics event fires only after checkout-time validation succeeds, immediately before the Paze web session opens."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]}," to correlate analytics events with server-side logs and PXP reports."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"integration-examples","__idx":8},"children":["Integration examples"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"firebase-analytics","__idx":9},"children":["Firebase analytics"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"import FirebaseAnalytics\n\nanalyticsEvent: { event in\n    if let clickEvent = event as? PazeButtonClickAnalyticsEvent {\n        Analytics.logEvent(\"paze_button_click\", parameters: [\n            \"component_id\": clickEvent.componentId,\n            \"merchant_transaction_id\": clickEvent.merchantTransactionId,\n            \"session_id\": clickEvent.sessionId\n        ])\n    }\n\n    if let checkoutComplete = event as? PazeCheckoutCompletedAnalyticsEvent {\n        Analytics.logEvent(\"paze_checkout_complete\", parameters: [\n            \"merchant_transaction_id\": checkoutComplete.merchantTransactionId,\n            \"session_id\": checkoutComplete.sessionId\n        ])\n    }\n\n    if let authFailed = event as? PazeAuthorisationFailedAnalyticsEvent {\n        Analytics.logEvent(\"paze_authorisation_failed\", parameters: [\n            \"merchant_transaction_id\": authFailed.merchantTransactionId,\n            \"session_id\": authFailed.sessionId\n        ])\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"segment","__idx":10},"children":["Segment"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"analyticsEvent: { event in\n    if let clickEvent = event as? PazeButtonClickAnalyticsEvent {\n        Analytics.shared().track(\"Paze button clicked\", properties: [\n            \"componentId\": clickEvent.componentId,\n            \"merchantTransactionId\": clickEvent.merchantTransactionId,\n            \"sessionId\": clickEvent.sessionId\n        ])\n    }\n\n    if let checkoutComplete = event as? PazeCheckoutCompletedAnalyticsEvent {\n        Analytics.shared().track(\"Paze checkout completed\", properties: [\n            \"merchantTransactionId\": checkoutComplete.merchantTransactionId,\n            \"sessionId\": checkoutComplete.sessionId\n        ])\n    }\n\n    if let decryptionFailed = event as? PazeDecryptionFailedAnalyticsEvent {\n        Analytics.shared().track(\"Paze decryption failed\", properties: [\n            \"merchantTransactionId\": decryptionFailed.merchantTransactionId,\n            \"sessionId\": decryptionFailed.sessionId\n        ])\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"best-practices","__idx":11},"children":["Best practices"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"conversion-funnel-tracking","__idx":12},"children":["Conversion funnel tracking"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Build a complete picture of your Paze conversion funnel by combining SDK analytics events with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPresentmentResolved"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"var funnelStages: [String: Int] = [\n    \"buttonVisible\": 0,\n    \"buttonRendered\": 0,\n    \"buttonClicked\": 0,\n    \"checkoutCompleted\": 0,\n    \"decryptionCompleted\": 0,\n    \"paymentAuthorised\": 0\n]\n\nconfig.onPresentmentResolved = { isVisible in\n    if isVisible { funnelStages[\"buttonVisible\", default: 0] += 1 }\n}\n\nlet checkoutConfig = CheckoutConfig(\n  // ... session and transactionData\n    analyticsEvent: { event in\n        switch event {\n        case is PazeButtonRenderedAnalyticsEvent:\n            funnelStages[\"buttonRendered\", default: 0] += 1\n        case is PazeButtonClickAnalyticsEvent:\n            funnelStages[\"buttonClicked\", default: 0] += 1\n        case is PazeCheckoutCompletedAnalyticsEvent:\n            funnelStages[\"checkoutCompleted\", default: 0] += 1\n        case is PazeDecryptionCompletedAnalyticsEvent:\n            funnelStages[\"decryptionCompleted\", default: 0] += 1\n        case let postAuth as PostAuthorisationAnalyticsEvent where postAuth.componentType == \"paze-button\":\n            funnelStages[\"paymentAuthorised\", default: 0] += 1\n            print(\"Paze conversion funnel:\", funnelStages)\n        default:\n            break\n        }\n    }\n)\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"error-tracking-and-alerting","__idx":13},"children":["Error tracking and alerting"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Track operational failures using Paze failure events and shared component errors:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"let pazeButton = try pxpCheckout.create(.pazeButton, componentConfig: pazeConfig)\nguard let pazeComponentId = (pazeButton as? PazeButtonComponent)?.containerId else {\n    return\n}\n\nanalyticsEvent: { event in\n    if let componentError = event as? ComponentErrorAnalyticsEvent,\n       componentError.componentId == pazeComponentId {\n        trackError(\"paze_component_error\", properties: [\n            \"errorCode\": componentError.errorCode ?? \"\",\n            \"errorMessage\": componentError.errorMessage,\n            \"sessionId\": componentError.sessionId\n        ])\n    }\n\n    switch event {\n    case is PazeDecryptionFailedAnalyticsEvent,\n         is PazeAuthorisationFailedAnalyticsEvent,\n         is PazeSdkInitialisationFailedAnalyticsEvent,\n         is PazeCheckoutFailedAnalyticsEvent,\n         is PazeCompleteFailedAnalyticsEvent:\n        if let pazeEvent = event as? PazeAnalyticsEvent {\n            trackError(\"paze_flow_error\", properties: [\n                \"eventName\": pazeEvent.eventName,\n                \"merchantTransactionId\": pazeEvent.merchantTransactionId,\n                \"additionalData\": String(describing: pazeEvent.additionalData)\n            ])\n        }\n    default:\n        break\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PxpCheckout.create(_:componentConfig:)"]}," returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BaseComponent"]},", which doesn't expose ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["containerId"]},". Cast to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeButtonComponent"]},", or capture ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]}," from the first ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeAnalyticsEvent"]}," in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["analyticsEvent"]}," if you prefer to avoid a cast."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK also emits a generic ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentLifecycleAnalyticsEvent"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventType: .mount"]}," for Paze when presentment validation succeeds (alongside ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeButtonRendered"]},"). Paze doesn't emit mount on first view attach if presentment hasn't completed. This is separate from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeButtonRendered"]},". Types such as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeAuthorisationInitiatedAnalyticsEvent"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeAuthorisationCompletedAnalyticsEvent"]}," exist in the SDK but aren't emitted by the Paze button component. Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeTransactionInitiated"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PostAuthorisation"]}," instead."]}]}]},"headings":[{"value":"Analytics","id":"analytics","depth":1},{"value":"Overview","id":"overview","depth":2},{"value":"Consume an event","id":"consume-an-event","depth":2},{"value":"Supported events","id":"supported-events","depth":2},{"value":"Paze-specific events","id":"paze-specific-events","depth":3},{"value":"Shared lifecycle events during Paze payments","id":"shared-lifecycle-events-during-paze-payments","depth":3},{"value":"Event data","id":"event-data","depth":3},{"value":"When each event fires","id":"when-each-event-fires","depth":2},{"value":"Integration examples","id":"integration-examples","depth":2},{"value":"Firebase analytics","id":"firebase-analytics","depth":3},{"value":"Segment","id":"segment","depth":3},{"value":"Best practices","id":"best-practices","depth":2},{"value":"Conversion funnel tracking","id":"conversion-funnel-tracking","depth":3},{"value":"Error tracking and alerting","id":"error-tracking-and-alerting","depth":3}],"frontmatter":{"seo":{"title":"Analytics"}},"lastModified":"2026-06-30T10:00:28.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/checkout/components/ios/paze/analytics","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}