CompositeAnalyticsClient

Forwards every call to all configured clients, so apps can fan out to multiple providers.

Each client is isolated: an exception from one provider SDK is logged to logger and does not stop the remaining clients from receiving the call (nor propagate to the caller). Analytics is observational and must never crash a user flow. Logger failures are isolated too. CancellationException propagates to preserve coroutine cancellation.

Constructors

Link copied to clipboard
constructor(clients: List<AnalyticsClient>, logger: KommonLogger = NoOpLogger)
constructor(vararg clients: AnalyticsClient)

Functions

Link copied to clipboard
open override fun flush()

Flush pending events.

Link copied to clipboard
open override fun identify(userId: String)

Identify a user with a unique ID.

Link copied to clipboard
open override fun increment(property: String, value: Double)

Increment a numeric user property.

Link copied to clipboard
open override fun initialize(token: String, serverUrl: String? = null)

Initialize the analytics SDK.

Link copied to clipboard
open override fun reset()

Reset user identity (logout).

Link copied to clipboard
open override fun setUserProperties(properties: Map<String, Any>)

Set user properties.

Link copied to clipboard
open override fun track(event: AnalyticsEvent)

Track an event with optional properties.

Link copied to clipboard
open override fun trackScreen(name: String, properties: Map<String, Any> = emptyMap())

Track a screen view.