Skip to content

alexxxdev/AnalyticsTracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AnalyticsTracker

Annotation based tracking handler

Using

buildscript {
  repositories {
	  maven { url 'https://jitpack.io' }
	}
  dependencies{
    implementation 'com.github.alexxxdev:AnalyticsTracker:1.1.0'
    kapt 'com.github.alexxxdev:AnalyticsTracker:1.1.0'
  }
}
@Analytics
class AnyAnalytics : AnalyticsHandler {
    override fun send(name: String, attrs: Map<String, Any?>) {
        ...
    }
}
class Foo {
    @AnalyticsAttr
    val id:Int,
    @AnalyticsAttr("name")
    var name:String
    ...
}
val foo = Foo()
AnalyticsTracker.send("event name", foo)

or

AnalyticsTracker.send("event name")
AnalyticsTracker.send("event name", mapOf(...))