track

fun track(name: String, attributes: Map<String, Any?> = emptyMap())

Track a custom event.

Parameters

name

wire event name (e.g. productViewed). MUST NOT be one of the reserved internal names (e.g. SWAN_NOTIFICATION_ACK); use the dedicated capability API instead.

attributes

caller-provided payload. Auto-enriched with platform, deviceModal, deviceBrand, country, currency, businessUnit, deviceId, sessionId.


fun track(name: String, attributes: JsonObject)

Track a custom event with a pre-built JsonObject payload.

Use this when you already have a strongly-typed JSON payload — it skips the Map<String, Any?>JsonObject conversion in mapToJsonObject.