AnalyticsLogger

A singleton object responsible for handling analytics logging throughout the Airwallex SDK. Provides methods to log various types of events including page views, errors, API errors, actions, and payment views.

Types

Link copied to clipboard
object Field

Constants for event field keys

Link copied to clipboard
object LaunchType

Constants for launch type values

Link copied to clipboard
object Layout

Constants for layout type values

Functions

Link copied to clipboard
Link copied to clipboard
fun initialize(context: Context)

Initializes the analytics tracker with the provided context.

Link copied to clipboard

Check if analytics session is already set up for the given session. Returns false if session has changed, allowing re-initialization.

Link copied to clipboard
fun logAction(actionName: String, additionalInfo: Map<String, Any>? = null)

Logs a user action event.

Link copied to clipboard
fun logApiError(eventName: String, url: String, exception: AirwallexException)

Logs an API error event.

Link copied to clipboard
fun logError(eventName: String, additionalInfo: Map<String, Any>)

Logs a generic error event.

fun logError(eventName: String, exception: AirwallexException, additionalInfo: Map<String, Any>? = null)

Logs an error event with exception details.

Link copied to clipboard
fun logPageView(pageName: String, additionalInfo: Map<String, Any>? = null)

Logs a page view event.

Link copied to clipboard
fun logPaymentView(viewName: String, additionalInfo: Map<String, Any>? = null)

Logs a payment method view event.

Link copied to clipboard
fun setSessionInformation(transactionMode: String, launchType: String, expressCheckout: Boolean, layout: String? = null, paymentIntentId: String? = null, showsGooglePayAsPrimaryButton: Boolean? = null)

Sets the current session information.

Link copied to clipboard
fun setupSession(session: AirwallexSession, launchType: String, layout: String? = null, showsGooglePayAsPrimaryButton: Boolean? = null)

Helper function to set up analytics session information from an AirwallexSession.

Link copied to clipboard
fun updateAccountId(accountId: String?)

Updates the account ID in the analytics tracker.

Link copied to clipboard

Updates extra common data in the analytics tracker. This allows cross-platform SDKs (e.g., Flutter, React Native) to set custom fields.