trackImpression

fun Modifier.trackImpression(name: String, properties: JsonObject = EmptyJsonObject, target: String? = null, minDurationMs: Long = 500, minFractionVisible: Float = 0.5f): Modifier

Fires name the first time this element becomes visible — at least minFractionVisible of its bounds inside the viewport for at least minDurationMs — and never again for the lifetime of this composable instance, even if it later scrolls out of view and back. Built on the stable androidx.compose.ui.layout.onVisibilityChanged; that API itself re-fires on every visibility transition, so the "only once" bookkeeping happens here.

Screen/section from the ambient ScreenContext (see TrackedScreen) are merged into properties automatically when this element is nested inside one.