{"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 get automatically triggered when significant actions or states occur within the drop-in. These allow you to monitor every aspect 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 should be consumed in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["analyticsEvent"]}," callback when initialising Drop-in."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For example:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"import com.pxp.checkout.checkoutdropin.CheckoutDropIn\nimport com.pxp.checkout.checkoutdropin.types.CheckoutDropInConfig\nimport com.pxp.checkout.analytics.BaseAnalyticsEvent\n\nval checkoutDropIn = CheckoutDropIn.initialize(\n    context = context,\n    config = CheckoutDropInConfig(\n        environment = Environment.TEST,\n        session = sessionData,\n        ownerType = \"MerchantGroup\",\n        ownerId = \"MERCHANT-1\",\n        transactionData = DropInTransactionData(\n            amount = 99.99,\n            currency = \"USD\",\n            entryType = EntryType.Ecom,\n            intent = DropInTransactionIntentData(\n                card = IntentType.Authorisation,\n                paypalDropInIntent = DropInPayPalIntentType.Authorisation\n            ),\n            merchant = \"MERCHANT-1\",\n            merchantTransactionId = UUID.randomUUID().toString(),\n            merchantTransactionDate = { Instant.now().toString() }\n        ),\n        onGetShopper = {\n            Shopper(id = \"shopper-001\")\n        },\n        analyticsEvent = { event: BaseAnalyticsEvent ->\n            Log.d(\"Analytics\", \"Event: ${event.eventName}\")\n            \n            // Send to your analytics platform\n            sendToAnalyticsPlatform(event)\n        },\n        onSuccess = { result ->\n            verifyPaymentOnBackend(result)\n        },\n        onError = { error ->\n            Log.e(\"Checkout\", \"Payment failed: ${error.message}\")\n        }\n    )\n)\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"event-structure","__idx":3},"children":["Event structure"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each analytics event contains 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":"30%","data-label":"Property"},"children":["Property "]},{"$$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":["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":["\"payment_method_selected\""]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"payment_submitted\""]},")."]}]},{"$$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":["String"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["When the event occurred, in ISO 8601 format."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["properties"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["Map<String, Any>?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Additional event-specific properties (varies by event type)."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"common-analytics-events","__idx":4},"children":["Common analytics events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The drop-in automatically triggers the following events during the payment journey:"]},{"$$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":"40%","data-label":"Event name"},"children":["Event name "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"60%","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":["drop_in_initialized"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when the drop-in is successfully initialised."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["drop_in_rendered"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when the drop-in UI is rendered on screen."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_method_displayed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when a payment method is displayed to the customer."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_method_selected"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when the customer selects a payment method."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_details_entered"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when the customer completes entering payment details."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_submitted"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when the customer submits the payment."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_processing"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when payment processing begins."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_succeeded"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when the payment completes successfully."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_failed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when the payment fails."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_cancelled"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when the customer cancels the payment."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["three_d_secure_started"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when 3D Secure authentication begins."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["three_d_secure_completed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when 3D Secure authentication completes."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["validation_error"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when field validation fails."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sdk_error"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fired when an SDK error occurs."]}]}]}]}]}]},"headings":[{"value":"Analytics","id":"analytics","depth":1},{"value":"Overview","id":"overview","depth":2},{"value":"Consume an event","id":"consume-an-event","depth":2},{"value":"Event structure","id":"event-structure","depth":2},{"value":"Common analytics events","id":"common-analytics-events","depth":2}],"frontmatter":{"seo":{"title":"Analytics"}},"lastModified":"2026-05-20T14:05:06.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/checkout/drop-in/android/analytics","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}