Logs KPI (v5)
SDK provide methods to send KPI logs...
You can send a log instantly or a list of stacked logs after an app session.
Build your own KPI
- Step 1 : The first step consist in building a KPI builder
val kpibld = APKpi.Builder()
- Step 2 : Use this builder to give the tag you want to be sent
kpibld.tag = "your_tag"
- Step 3 : Choose KPI type among Event or View
kpibld.eventType()
//or
kpibld.viewType()
- Step 4 : Build and send the KPI to the stack
val kpi = kpibld.build()
APStatsManager.sendKpi(kpi)
- Step 5 (optional) : Request stats to be send instantly
APStatsManager.sendSavedState()
Full sample
val kpibld = APKpi.Builder()
kpibld.tag = "my_tag"
kpibld.eventType()
//kpibld.viewType()
val kpi = kpibld.build()
APStatsManager.sendKpi(kpi)
//APStatsManager.sendSavedState()
UTILS
Utils class have been created to simplify use
- Event instant log :
As it is mentioned instant logs are sent just after being created.
APLogUtils.instantLog("your_event_tag")
- Event session log :
Session logs are sent only after a user session was done in the application.
APLogUtils.log("your_event_tag")
Updated almost 3 years ago