track

fun track(event: String, properties: Map<String, Any> = mapOf()): MetricsResponse

Tracks an event for analytics purposes.

Return

A MetricsResponse indicating the result of the operation.

Parameters

event

The name of the event to track.

properties

A map containing event-specific properties.

Throws

on a backend HTTP 400 response. Wrap the call in try/catch — this method does not return a Result<T> and the throw escapes uncaught.

If the API request fails or response parsing encounters an issue (HTTP 401 → HttpUnauthorized, other 4xx/5xx → HttpRequestFailed, transport failures → raw IOException).