capture

abstract fun capture(distinctId: String, event: String, properties: Map<String, Any>? = null, userProperties: Map<String, Any>? = null, userPropertiesSetOnce: Map<String, Any>? = null, groups: Map<String, String>? = null, timestamp: Date? = null, appendFeatureFlags: Boolean = false)

Captures events

Parameters

distinctId

the distinctId of the user performing the event

event

the event name

properties

the custom properties

userProperties

the user properties, set as a "$set" property, Docs https://posthog.com/docs/product-analytics/user-properties

userPropertiesSetOnce

the user properties to set only once, set as a "$set_once" property, Docs https://posthog.com/docs/product-analytics/user-properties

groups

the groups, set as a "$groups" property, Docs https://posthog.com/docs/product-analytics/group-analytics

timestamp

the timestamp for the event

appendFeatureFlags

when true, enriches the event with feature flag properties


open fun capture(distinctId: String, event: String, options: PostHogCaptureOptions)

Captures events

Parameters

distinctId

the distinctId

event

the event name

options

the capture options containing properties, userProperties, userPropertiesSetOnce, groups, and appendFeatureFlags


open fun capture(distinctId: String, event: String)

Captures events

Parameters

event

the event name

distinctId

the distinctId