Package-level declarations

Types

Link copied to clipboard

Amplitude's lifecycle and identity, over an Amplitude the consumer owns.

Link copied to clipboard
fun interface AmplitudeEventTracker

One pending call to Amplitude on behalf of one event.

Link copied to clipboard

Turns an event into the Amplitude calls it should produce — or declines it.

Link copied to clipboard

One pending call to Amplitude on behalf of one property.

Link copied to clipboard

The AmplitudeEventTrackerFactory counterpart for properties, with the same partial contract.

Link copied to clipboard
data class AmplitudeRevenueEvent(val name: String, val price: Double, val quantity: Int = 1, val productId: String? = null, val revenueType: String? = null, val currency: String? = null, val revenue: Double? = null, val receipt: String? = null, val receiptSig: String? = null, val insertId: String? = null, val parameters: Map<String, AnalyticsValue> = emptyMap()) : Event

A purchase as Amplitude's revenue API takes it, so it lands in Amplitude's revenue charts and LTV rather than as an ordinary event. The fields are Amplitude's Revenue fields, under Amplitude's names.

Link copied to clipboard

Asks each factory in order and takes the first answer that is not a decline.

Link copied to clipboard

Asks each factory in order and takes the first answer that is not a decline.

Link copied to clipboard

Tracks any event under its own name with its parameters as event properties. Claims everything, so it only belongs last in a chain — anything after it is unreachable.

Link copied to clipboard

Sets any property as an Amplitude user property. Claims everything, so it belongs last in a chain.

Fails on any event that reaches it. Put it last in a chain to turn an event nobody wired up into a loud failure rather than a silent no-op.

Link copied to clipboard

Claims every ScreenViewEvent and declines everything else, which is GenericAmplitudeEventTrackerFactory's business.

Properties

Link copied to clipboard

The value as Amplitude should store it. Amplitude properties are JSON, so numbers and booleans go across as themselves rather than as text and stay usable in numeric filters.

Functions

Link copied to clipboard

Event parameters as Amplitude should store them; see asAmplitudeValue.

Link copied to clipboard

Builds the Amplitude payload for revenue, with AmplitudeRevenueEvent.parameters as its properties. Public because a custom AmplitudeEventTracker almost always needs it.