AnalyticsLog

data class AnalyticsLog(val tag: String, val screenClass: String, val timestamp: Long, val type: AnalyticsLogType)

Represents a single analytics event log entry.

This immutable data class captures all essential information about an analytics event, including what happened (tag), where it happened (screenClass), when it happened (timestamp), and what type of event it was (type).

The class automatically handles timestamp formatting for display purposes through the formattedTimestamp property.

See also

Samples

val screenLog = AnalyticsLog(
    tag = "HomeScreen",
    screenClass = "com.example.ui.HomeScreen",
    timestamp = Clock.System.now().toEpochMilliseconds(),
    type = AnalyticsLogCategory.Screen.View
)

Constructors

Link copied to clipboard
constructor(tag: String, screenClass: String, timestamp: Long, type: AnalyticsLogType)

Properties

Link copied to clipboard

The fully qualified class name or identifier of the screen/component where the event occurred (e.g., "com.example.ui.HomeScreen").

Link copied to clipboard
val tag: String

The name or identifier of the analytics event (e.g., "user_login", "HomeScreen").

Link copied to clipboard

Unix timestamp in milliseconds representing when the event occurred.

Link copied to clipboard

The category of this analytics event.