Godot (Beta)

Tracking Revenue

The Noctua SDK supports purchase and revenue tracking for monetization analytics.

Track Purchase

This event is used to track purchase revenue.

Noctua.track_purchase(
    orderId = "order-123",
    amount = 9.99,
    currency = "USD",
    extraPayload = mutableMapOf("sku" to "premium_upgrade")
)

Track Custom Events with Revenue

This event is used to track custom events with revenue, allowing revenue data to be displayed directly in the Adjust dashboard, as well as in Firebase and Facebook. For example, to track ad impression revenue, call it in the OnAdRevenuePaidEvent callback. To track purchase revenue, call it in the purchase success callback.

Noctua.track_custom_event_with_revenue(
    eventName = "donation",
    revenue = 5.0,
    currency = "USD",
    payload = mutableMapOf("campaign" to "fundraiser")
)

Track Ad Revenue

You can track ad revenue events using the Noctua SDK to measure monetization performance across ad networks.

Noctua.track_ad_revenue(
    source = "applovin_max_sdk",
    revenue = 1.23,
    currency = "USD",
    extraPayload = mutableMapOf("ad_unit" to "banner")
)

Parameters

  • source: The source of the ad revenue. Use admob_sdk for AdMob or applovin_max_sdk for AppLovin MAX.
  • revenue: The revenue of the ad.
  • currency: The currency of the ad revenue.
  • parameters: A dictionary of parameters to track with the event.

Data Sources

Applovin

func _on_ad_revenue_paid_event(ad_info: Dictionary) -> void:
    var currency: String = "USD" # Hardcoded
    var platform: String = "AppLovin"
    var revenue: float = ad_info.get("revenue", 0.0)
    var network_source: String = ad_info.get("network_name", "")
    var ad_unit: String = ad_info.get("ad_unit_id", "")
    var ad_format: String = ad_info.get("placement", "")

    # Example: Track ad revenue
    Noctua.track_ad_revenue("applovin_max_sdk", revenue, currency, {
        "platform": platform,
        "networkSource": network_source
    })

    # Example: Track custom event with revenue
    Noctua.track_custom_event_with_revenue("ad_impression", revenue, currency, {
        "platform": platform,
        "networkSource": network_source
    })

Admob

private fun setOnPaidEventListener(ad: RewardedAd) {
  ad.onPaidEventListener = OnPaidEventListener { adValue ->
    // Extract the impression-level ad revenue data.
    val valueMicros = adValue.valueMicros
    val revenue = valueMicros / 1_000_000.0
    val currencyCode = adValue.currencyCode

    // Get the ad unit ID.
    val adUnitId = ad.adUnitId

    // Extract ad response information.
    val loadedAdapterResponseInfo = ad.responseInfo.loadedAdapterResponseInfo
    val adSourceName = loadedAdapterResponseInfo?.adSourceName
    // Example how to track ad revenue
    Noctua.track_ad_revenue(
        "admob_sdk",
        revenue,
        currencyCode,
        mapOf(
            "adSourceName" to adSourceName
        )
    )

    // Example how to track custom event with revenue
    Noctua.track_custom_event_with_revenue(
        "ad_impression",
        revenue,
        currencyCode,
        mapOf(
            "adSourceName" to adSourceName
        )
    )
  }
}

Sources

Previous
Custom events tracking