How to track USSD flows in your Android app
USSD powers hundreds of millions of transactions across Africa every day. Mobile money, banking, bill payments and government services all run on USSD. Yet most analytics tools have no way to track it.
What is USSD
USSD (Unstructured Supplementary Service Data) is a protocol used by mobile phones to communicate with service providers. When a user dials *737# or *822#, they are using USSD.
Unlike apps, USSD sessions are synchronous and stateless. Each menu is a separate network request. A user completing a mobile money transfer might go through 5-7 USSD screens.
Why USSD tracking matters
If your app launches a USSD flow and you cannot track whether the user completed it, you are flying blind. You do not know your USSD conversion rate, where users drop off or which flows are confusing.
Tracking USSD with Unilitix
// Track USSD flow start
Unilitix.trackEvent("ussd_flow_started", mapOf(
"shortcode" to "*737#",
"flow" to "mobile_money_transfer"// Track USSD screen views Unilitix.trackScreen("ussd_transfer_amount")
// Track completion Unilitix.trackEvent("ussd_flow_completed", mapOf( "shortcode" to "*737#", "flow" to "mobile_money_transfer", "amount" to 5000 )) ```
Listening for USSD results
val ussdCallback = object : TelephonyManager.UssdResponseCallback() {
override fun onReceiveUssdResponse(
telephonyManager: TelephonyManager,
request: String,
response: CharSequence
) {
Unilitix.trackEvent("ussd_response", mapOf(
"request" to request,
"success" to true
))override fun onReceiveUssdResponseFailed( telephonyManager: TelephonyManager, request: String, failureCode: Int ) { Unilitix.trackEvent("ussd_response", mapOf( "request" to request, "success" to false, "failureCode" to failureCode )) } } ```
Get started
Try Unilitix free at app.unilitix.com