// Проводим инициализацию
val analytiks: Analytiks = Analytiks.Builder()
.addClient(GoogleAnalyticsClient()) // Firebase Analytics
.addClient(MixpanelAnalyticsClient(token = "YOUR_TOKEN"))
.addClient(TimberAnalyticsClient()) // For debug logging
.build()
analytiks.initialize(applicationContext)
// Track a simple event
analytiks.logEvent("user_signup")
// Track an event with properties
analytiks.logEvent(
eventName = "purchase_completed",
properties = mapOf(
"product_id" to "12345",
"price" to 29.99,
"currency" to "USD"
)
)
// Identify a user
analytiks.identify(userId = "user_12345")
// Set user properties
analytiks.setUserProperty("subscription_type", "premium")
// Send all queued events immediately
analytiks.pushAll()
#android #аналитика