Skip to main content
Version: 2.1.x

Goal Tracking & Conversion Funnels in KMP

A Goal is a timed measurement of a critical business journey (e.g. user signup, checkout, subscription upgrade, onboarding, KYC verification).

Appxiom's Goal Friction Impact (GFI) connects bugs, crashes, ANRs, and API failures directly to their impact on goal completion, drop-off rates, and business revenue.


Candidate Workflows​

Look for flows where business value is created or lost:

  • Authentication: user_signup, user_login, password_reset
  • Commerce: cart_checkout, order_placement, subscription_purchase
  • Onboarding: first_time_onboarding, profile_setup
  • Operations: document_upload, kyc_verification, booking_reservation

Goal Naming Rules & Restrictions​

Appxiom strictly enforces naming conventions on the backend:

  • Allowed characters: Only alphanumeric characters (A-Z, a-z, 0-9) and underscores (_).
  • Forbidden characters: Hyphens, periods, spaces, slashes, and special symbols are stripped automatically.
  • Maximum length: 64 characters. Names exceeding 64 characters are truncated.

Instrumentation Pattern​

ViewModel & Coroutine Lifecycle​

Store the goalId: Long returned by Ax.beginGoal and ensure it is completed upon successful flow termination:

package com.example.app.viewmodel

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.launch
import tech.appxiom.kmp.Ax

class CheckoutViewModel(
private val paymentRepository: PaymentRepository
) : ViewModel() {

private var activeGoalId: Long? = null

fun onCheckoutInitiated() {
// Begin goal measurement:
activeGoalId = Ax.beginGoal("CheckoutViewModel", "cart_checkout")
}

fun submitPayment(orderId: String) {
viewModelScope.launch {
try {
paymentRepository.charge(orderId)

// Complete goal on success:
activeGoalId?.let { id ->
Ax.completeGoal("CheckoutViewModel", id)
activeGoalId = null
}
} catch (t: Throwable) {
// If an exception occurs, report it with context:
Ax.reportError(t, fatal = false, customInfo = "Failed during cart_checkout")
// Note: Do NOT complete the goal; incomplete goals are tracked as friction/drop-offs
}
}
}
}

Analyzing Goal Friction Impact (GFI)​

When a crash, ANR, or network error occurs while a goal is active:

  1. Appxiom attributes the failure to the in-flight goal (cart_checkout).
  2. Your team can prioritize fixes based on business impact rather than raw exception frequency.

Next Steps​

Learn how to preserve debug symbols for release builds in Release Symbolication.