Noctua Labs
  • Noctua Labs
    • Tutorial
      • Accounts
      • Home and Navigation
      • Integration
      • Budgets
      • Create Ads
      • My Ads
      • Ads Inspiration
      • Analytics
      • Add-Ons
    • Knowledge Bank
      • English
      • 中文
    • SDK Integration
      • Getting Started
      • Preparation
        • Android
          • Installation
          • Configuration
          • Initialization
        • iOS
          • Installation
          • Configuration
          • Initialization
        • Unity
          • Installation
          • Configuration
          • Initialization
      • Features
        • Attribution and Measurements
          • Android
            • Track General Event
            • Track Purchase Event
          • iOS
            • Track General Event
            • Track Purchase Event
          • Unity
            • Track General Event
            • Track Purchase Event
Powered by GitBook
On this page
  1. Noctua Labs
  2. SDK Integration
  3. Features
  4. Attribution and Measurements
  5. Android

Track Purchase Event

Track Purchase Event

This function logs a purchase event with the specified order ID, purchase amount, currency, and optional additional parameters. It is used to track purchase transactions within an application.

Method Signature:

fun trackPurchaseEvent(orderId: String?, purchaseAmount: Double, currency: String?, parameters: Bundle? = null)

Parameters:

  • orderId (String?): The unique identifier for the order. This parameter is optional and can be null.

  • purchaseAmount (Double): The total amount of the purchase.

  • currency (String?): The currency of the purchase amount. This parameter is optional and can be null.

  • parameters (Bundle?, optional): A Bundle containing key-value pairs of additional data to be logged with the purchase event. This parameter is optional and can be null.

Example Usage:

// Without parameters
trackPurchaseEvent("12345", 99.99, "USD")

// With parameters
val params = Bundle().apply {
    putString("payment_method", "credit_card")
    putString("customer_type", "new")
}
trackPurchaseEvent("12345", 99.99, "USD", params)
PreviousTrack General EventNextiOS

Last updated 11 months ago