{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["sub-heading","br","details"]},"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 that are automatically triggered when significant actions or states occur within the drop-in. These allow you to monitor every aspect of the payment journey across cards, PayPal, Apple Pay, Paze, and other enabled payment methods."]},{"$$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 should be consumed in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["analyticsEvent"]}," callback when initialising Drop-in."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"basic-example","__idx":3},"children":["Basic example"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following example wires ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["analyticsEvent"]}," on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CheckoutDropInConfig"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"import PXPCheckoutSDK\n\nlet config = CheckoutDropInConfig(\n    environment: .test,\n    session: sessionData,\n    transactionData: DropInTransactionData(\n        amount: Decimal(string: \"99.99\") ?? 0,\n        currency: \"USD\",\n        entryType: .ecom,\n        intent: DropInTransactionIntentData(\n            card: .authorisation,\n            paypal: .authorisation\n        ),\n        merchantTransactionId: UUID().uuidString,\n        merchantTransactionDate: { Date() }\n    ),\n    merchantShopperId: \"shopper-001\",\n    ownerId: \"MERCHANT-1\",\n    onGetShopper: { async in\n        TransactionShopper(id: \"shopper-001\")\n    },\n    analyticsEvent: { event in\n        print(\"Analytics event: \\(event.eventName)\")\n        \n        // Send to your analytics platform\n        sendToAnalyticsPlatform(event)\n    },\n    onSuccess: { result in\n        verifyPaymentOnBackend(result)\n    },\n    onError: { paymentMethod, error in\n        print(\"Payment failed: \\(error.errorMessage)\")\n    }\n)\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"typed-event-handling","__idx":4},"children":["Typed event handling"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Since event-specific fields live on subclasses, cast to the concrete type for typed access:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"analyticsEvent: { event in\n    switch event {\n    case let componentEvent as ComponentInteractionAnalyticsEvent:\n        print(\"Component interaction:\")\n        print(\"- Type: \\(componentEvent.componentType)\")\n        print(\"- Interaction: \\(componentEvent.interactionType.rawValue)\")\n        print(\"- ID: \\(componentEvent.componentId)\")\n        \n    case let errorEvent as ComponentErrorAnalyticsEvent:\n        print(\"Component error:\")\n        print(\"- Code: \\(errorEvent.errorCode ?? \"unknown\")\")\n        print(\"- Message: \\(errorEvent.errorMessage)\")\n        print(\"- Component ID: \\(errorEvent.componentId)\")\n        \n    case let lifecycleEvent as ComponentLifecycleAnalyticsEvent:\n        print(\"Component lifecycle:\")\n        print(\"- Event: \\(lifecycleEvent.eventType.rawValue)\")\n        print(\"- Component ID: \\(lifecycleEvent.componentId)\")\n        \n    default:\n        print(\"Analytics event: \\(event.eventName)\")\n    }\n    \n    // Encode and send to analytics platform\n    do {\n        let encoder = JSONEncoder()\n        encoder.dateEncodingStrategy = .iso8601\n        let data = try encoder.encode(event)\n        sendToAnalyticsPlatform(data)\n    } catch {\n        print(\"Failed to encode analytics event: \\(error)\")\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"event-structure","__idx":5},"children":["Event structure"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All analytics events inherit from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BaseAnalyticsEvent"]}," and contain the following base properties:"]},{"$$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":{"width":"15%","data-label":"Property"},"children":["Property "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"85%","data-label":"Description"},"children":["Description "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The name of the analytics event (e.g., ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"ComponentInteraction\""]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"ApplePaySheetOpened\""]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The session ID for the current checkout session."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timestamp"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["Date"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["When the event occurred (Swift ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Date"]}," type)."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Event-specific fields are encoded as top-level properties on each subclass, not under a nested ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["properties"]}," object. For example, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentInteractionAnalyticsEvent"]}," adds ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["interactionType"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]}," as top-level fields."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"serialising-events","__idx":6},"children":["Serialising events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When sending events to external analytics platforms, you'll typically need to encode them to JSON:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"analyticsEvent: { event in\n    do {\n        let encoder = JSONEncoder()\n        encoder.dateEncodingStrategy = .iso8601\n        let data = try encoder.encode(event)\n        \n        // Send encoded data to analytics platform\n        sendToAnalyticsPlatform(data)\n    } catch {\n        print(\"Failed to encode analytics event: \\(error)\")\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ios-sdk-analytics-events","__idx":7},"children":["iOS SDK analytics events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The iOS SDK emits structured analytics events through several event classes. Each event inherits from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BaseAnalyticsEvent"]}," and adds event-specific fields."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"component-lifecycle-events","__idx":8},"children":["Component lifecycle events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following table lists component lifecycle events:"]},{"$$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":{"width":"30%","data-label":"Event name"},"children":["Event name "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"30%","data-label":"Swift class"},"children":["Swift class "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"40%","data-label":"Description"},"children":["Description "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentLifecycleEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentLifecycleAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when a component mounts or unmounts. Includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventType"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]},". Most drop-in components use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".mount"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".unmount"]}," (JSON: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"Mount\""]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"Unmount\""]},"). The SDK also defines ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Loaded"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Unloaded"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Callback"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onMounted"]}," for other components."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"component-interaction-events","__idx":9},"children":["Component interaction events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following table lists component interaction events:"]},{"$$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":{"width":"30%","data-label":"Event name"},"children":["Event name "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"30%","data-label":"Swift class"},"children":["Swift class "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"40%","data-label":"Description"},"children":["Description "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentInteraction"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentInteractionAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when a user interacts with a component. Includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["interactionType"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]},". Swift cases are ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".focus"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".blur"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".change"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".submit"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".paste"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".click"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".close"]},"; JSON encodes PascalCase raw values (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"Focus\""]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"Blur\""]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"Change\""]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"Submit\""]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"Paste\""]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"Click\""]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"Close\""]},")."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"component-error-events","__idx":10},"children":["Component error events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following table lists component error events:"]},{"$$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":{"width":"25%","data-label":"Event name"},"children":["Event name "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"35%","data-label":"Swift class"},"children":["Swift class "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"40%","data-label":"Description"},"children":["Description "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentError"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentErrorAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when a component error occurs. Includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errorCode"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errorMessage"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ErrorMessageShown"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MessageShownAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when an error or validation message is displayed to the user. Includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["messageContent"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["elementId"]},"."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"payment-lifecycle-events","__idx":11},"children":["Payment lifecycle events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following table lists shared payment lifecycle events. Each row shows the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventName"]}," string and its Swift class:"]},{"$$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":{"width":"25%","data-label":"Event name"},"children":["Event name "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"35%","data-label":"Swift class"},"children":["Swift class "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"40%","data-label":"Description"},"children":["Description "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentAbandonment"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentAbandonmentAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when a payment component is abandoned. Includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaymentAbandonment"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaymentAbandonmentAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when a payment flow is abandoned. Includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PreTokenization"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PreTokenizationAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired before card tokenisation begins. Includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionId"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PostTokenization"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PostTokenizationAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired after card tokenisation completes. Includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionId"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PreInitiateAuthentication"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PreInitiateAuthenticationAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired before 3D Secure authentication is initiated. Includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionId"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PostInitiateAuthentication"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PostInitiateAuthenticationAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired after 3D Secure authentication is initiated. Includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionId"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PreAuthentication"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PreAuthenticationAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired before 3D Secure authentication begins. Includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionId"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PostAuthentication"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PostAuthenticationAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired after 3D Secure authentication completes. Includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionId"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PreAuthorisation"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PreAuthorisationAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired before payment authorisation begins when the component's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]}," callback is set. Includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionId"]},". Drop-in wires this for card, PayPal, and Apple Pay."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PostAuthorisation"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PostAuthorisationAnalyticsEvent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired after the authorisation HTTP response is processed when the component's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostAuthorisation"]}," callback is set. Includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentType"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionId"]},". Drop-in wires this for card, PayPal, and Apple Pay."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"apple-pay-events","__idx":12},"children":["Apple Pay events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Apple Pay emits several specific analytics events:"]},{"$$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":{"width":"30%","data-label":"Event name"},"children":["Event name "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"70%","data-label":"Description"},"children":["Description "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayButtonClick"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when the customer taps the Apple Pay button."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePaySheetOpened"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when the Apple Pay payment sheet opens."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePaySheetCompleted"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when the customer completes the Apple Pay payment sheet."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayFlowCancelled"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when the customer cancels the Apple Pay flow."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayRetryAttempt"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when a retry is attempted after an Apple Pay failure."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayBlobDecryptionFailed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when Apple Pay payment data decryption fails."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayPaymentRequestCreationFailed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when Apple Pay payment request creation fails."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Apple Pay events extend ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayAnalyticsEvent"]}," and include ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["walletType"]}," (always ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"ApplePay\""]},"), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},", optional ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["customerID"]},", and optional ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["additionalData"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"paypal-events","__idx":13},"children":["PayPal events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["PayPal emits retry analytics events:"]},{"$$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":{"width":"30%","data-label":"Event name"},"children":["Event name "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"70%","data-label":"Description"},"children":["Description "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayPalRetryAttempt"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when a retry is attempted after a PayPal failure. Includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},", optional ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["customerID"]},", and retry count in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["additionalData"]},"."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["PayPal validation failures and errors are emitted through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentErrorAnalyticsEvent"]}," with PayPal-specific error codes and messages."]}]},"headings":[{"value":"Analytics","id":"analytics","depth":1},{"value":"Overview","id":"overview","depth":2},{"value":"Consume an event","id":"consume-an-event","depth":2},{"value":"Basic example","id":"basic-example","depth":3},{"value":"Typed event handling","id":"typed-event-handling","depth":3},{"value":"Event structure","id":"event-structure","depth":2},{"value":"Serialising events","id":"serialising-events","depth":3},{"value":"iOS SDK analytics events","id":"ios-sdk-analytics-events","depth":2},{"value":"Component lifecycle events","id":"component-lifecycle-events","depth":3},{"value":"Component interaction events","id":"component-interaction-events","depth":3},{"value":"Component error events","id":"component-error-events","depth":3},{"value":"Payment lifecycle events","id":"payment-lifecycle-events","depth":3},{"value":"Apple Pay events","id":"apple-pay-events","depth":3},{"value":"PayPal events","id":"paypal-events","depth":3}],"frontmatter":{"seo":{"title":"Analytics"}},"lastModified":"2026-07-14T09:12:22.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/checkout/drop-in/ios/analytics","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}