Skip to content

Jetpack Compose

implementation("com.cimka:cimka-compose:1.1.1")

No registration is needed — just use the helpers below.

import com.xhonaldo.cimka.compose.*

Call TrackCimkaScreens once, next to your NavHost. Every navigation logs a screen view plus screen_exit / screen_enter events.

val navController = rememberNavController()
TrackCimkaScreens(navController)
NavHost(navController, startDestination = "home") {
composable("home") { HomeScreen() }
composable("profile") { ProfileScreen() }
}

Wrap content that should count as its own screen:

CimkaScreen("FilterSheet") {
FilterSheetContent()
}

CimkaScreen provides LocalCimkaScreen, which clicks inside it use as their screen name.

A drop-in replacement for Modifier.clickable that also logs the interaction.

Row(modifier = Modifier.cimkaClick(label = "Dismiss banner") { onDismiss() }) {
/* ... */
}
Card(
modifier = Modifier.cimkaClick(
label = "Product card",
onLongClick = { showMenu() }, // logged as LONG_PRESS
) { openProduct() }
) { /* ... */ }
Parameter Default Description
label null Human-readable label shown in the dashboard.
elementId null Stable id. If omitted, derived from label ("Go to cart" → go_to_cart), else auto-generated.
enabled true Same as clickable.
role null Accessibility role.
onLongClick null Enables long-press handling.
onClick — Click handler.

Wrap an existing onClick — handy for Button, IconButton and other components that take a lambda:

Button(onClick = rememberCimkaClick(label = "Continue") { onContinue() }) {
Text("Continue")
}

Track taps on list rows with the list and item identity:

LazyColumn {
itemsIndexed(products, key = { _, p -> p.id }) { index, product ->
ProductRow(
product,
modifier = Modifier.cimkaListItem(
listId = "products",
itemId = product.id,
index = index,
) { open(product) }
)
}
}

Items are logged as products[<itemId>:<index>].