📊 Analytics Event Viewer
Flocon streams and displays analytics events emitted by your application in real time, making it easy for developers, QA engineers, and product teams to verify tracking payloads.
Overview
Every recorded event details: - Event Name: Unique tracking identifier - Parameters & Properties: Full key-value dictionary - Timestamp & Source: Accurate timestamp and stream category (e.g. Firebase, Segment, Custom)
Setup
dependencies {
debugImplementation("io.github.openflocon:flocon-analytics:LAST_VERSION")
releaseImplementation("io.github.openflocon:flocon-analytics-no-op:LAST_VERSION")
}
Usage
Log individual or batched events; the analyticsTableId is the stream they are displayed in on the desktop (e.g. firebase):
Flocon.analyticsPlugin.log(
AnalyticsEvent(
eventName = "button_clicked",
analyticsTableId = "firebase",
"button_id" analyticsProperty "checkout_pay",
"cart_total" analyticsProperty "49.99",
"currency" analyticsProperty "EUR"
)
)
To log several events to the same stream, create a sender once and reuse it:
val firebase = Flocon.analyticsPlugin.sender("firebase")
firebase.log("button_clicked", "button_id" analyticsProperty "checkout_pay")
Generic Analytics Forwarder
Forward all app tracking calls to Flocon alongside your existing provider:
class AnalyticsTracker(private val firebaseAnalytics: FirebaseAnalytics) {
// bound to the "app_telemetry" stream: no need to repeat it at each call
private val flocon = Flocon.analyticsPlugin.sender("app_telemetry")
fun track(event: String, parameters: Map<String, Any> = emptyMap()) {
// 1. Forward to Flocon Desktop
flocon.log(
eventName = event,
properties = parameters.map { it.key analyticsProperty it.value.toString() }
)
// 2. Forward to Firebase
val bundle = Bundle().apply {
parameters.forEach { (k, v) -> putString(k, v.toString()) }
}
firebaseAnalytics.logEvent(event, bundle)
}
}