Event Tracker
EventTracker is the single entry point for the EventTracker Android library.
The library captures events in the host app, persists them to a local database, and dispatches them to one or more configured in.singhangad.eventtracker.adapter.EventAdapter destinations. Network destinations use batched delivery with retry and dead-letter handling.
Initialization must happen exactly once per process, typically in Application.onCreate. After initialization, all calls are safe from any thread.
EventTracker.initialize(
context = applicationContext,
config = EventTrackerConfig.Builder()
.addAdapter(BackendBatchAdapter(endpoint = "https://api.example.com/v1/events"))
.addAdapter(FirebaseAdapter()) // requires :eventtracker-adapter-firebase
.batchSize(50)
.batchIntervalMs(30_000)
.maxRetries(8)
.build()
)
EventTracker.track("checkout_started", mapOf("cart_size" to 3))Since
1.0.0
See also
Functions
Number of events currently in the dead-letter queue.
Snapshot of internal counters for observability. Values are monotonically increasing within a process lifetime and reset to zero on process start.
Permanently delete all DLQ entries.
Move up to limit DLQ rows back into the live queue, with attempt_count reset to zero. Useful after a backend fix.
Delete all locally persisted events, including the dead-letter queue. Intended for GDPR / opt-out compliance and QA reset. Does not affect events already delivered to destinations.