⚠️ Warning: this project as been moved
See the new trikot repository for releases starting from 3.0.0.
Trikot.analytics
Elegant implementation of Multiplatform Analytics in ReactiveStreams.
Usage
See platform declaration on how to configure which service is used.
Declare your events
enum class AnalyticsEvents : AnalyticsEvent {
myAppEvent,
myClickEvent
}
Identify user
AnalyticsService.identifyUser(userId, mapOf("userProperty" to value))
Track an event
AnalyticsService.trackEvent(AnalyticsEvents.myAppEvent, mapOf("eventProperty" to value))
Track tap action
val button = MutableMetaButton()
button.onTap = TrackableMetaAction(AnalyticsEvents.myClickEvent) {
// Code to execute on tap
}
Firebase
iOS - swift extensions Android - firebase-ktx
Add more service
Implement AnalyticsService
Common
Import dependencies
Use the code bellow to import the core module of trikot analytics.
maven { url('https://s3.amazonaws.com/mirego-maven/public') }
api "com.mirego.trikot:analytics:$trikot_analytics_version"
If you wish to use the trikot.viewmodel
integration, you have to import it from a separate module.
api "com.mirego.trikot:analytics-viewmodel:$trikot_analytics_version"
License
Trikot.analytics is © 2018-2019 Mirego and may be freely distributed under the New BSD license. See the LICENSE.md
file.
About Mirego
Mirego is a team of passionate people who believe that work is a place where you can innovate and have fun. We’re a team of talented people who imagine and build beautiful Web and mobile applications. We come together to share ideas and change the world.
We also love open-source software and we try to give back to the community as much as we can.