trackImpression
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.
Does not suppress autocapture. Unlike trackClick, this marks nothing as instrumented: it reports a visibility event and never reports a click, so autocapture reporting a tap on this element duplicates nothing. Marking it was the original design and it cost an event rather than saving one — a tappable element that also reported an impression produced no click event at all, on either platform (#158). An element that should report neither is what autographIgnore is for.
The event carries kind impression and both thresholds in its envelope metadata (see dev.ynagai.autograph.EventMetadata), so a dashboard can tell which definition of "seen" it counts. Inside a TrackedScreen it also carries the screen's visit id (#242).
In a lazy list, "this composable instance" is the wrong unit: an item scrolled out of view is disposed and reports again when it scrolls back. Use the overload that takes a key there.
trackImpression, de-duplicated by key rather than by composable instance (#243): within one unit, an item reports at most once however often it is disposed and re-composed — which is what a lazy list does to an item scrolled out of view and back. Pass the same value as the list's own key. It must keep a stable equals / hashCode for as long as the unit lasts; it is held, not reported, so put whatever identifies the item for analysis in properties as well.
The unit is the enclosing TrackedScreen's visit — the same unit its screen_view_id names — or an ImpressionScope, whichever is innermost:
A new visit reports again: a renamed screen, or a return that re-creates the screen's composition. A change of section keeps the visit and does not; to count per section, include it in key or target.
An impression is one definition applied to one item: name, both thresholds, the effective target (target, else
properties["target"], else an enclosing AutographScope's) and key. The same item in two lists with different names or targets reports in each; instrumented identically twice, it reports once.When the unit starts over, or this element's key changes, its visibility measurement starts over too: time spent visible before does not count toward the new one.
Outside both, there is nothing to de-duplicate in. The element then behaves as the overload without a key — once per composable instance — and a one-time console warning says so.
"Once" means once per emission attempt: the key is recorded after track returns, so it marks an event handed to the tracker, not one delivered — delivery is not observable here. A track that throws is not caught: it fails the effect that times the dwell, as it would any LaunchedEffect.
Not rememberSaveable: that would outlive the visit into the navigation back stack's saved state and not report again on a revisit, and in a list without keys it is positional, so the record can move to a different item.