Skip to content

Instantly share code, notes, and snippets.

@amsterdatech
Last active January 18, 2021 21:19
Show Gist options
  • Save amsterdatech/5c36b7432ae58cadf0ed5a04ae7cf9fd to your computer and use it in GitHub Desktop.
Save amsterdatech/5c36b7432ae58cadf0ed5a04ae7cf9fd to your computer and use it in GitHub Desktop.
/**After create your Tracker classes and initialize your Analytics implementation inside Application you can use this simple library like the examples below*/
//Track PageViews
analytics.track {
name = EVENT.PAGE_VIEWED
put(EVENT.PROPERTY_PAGE_NAME, "SCREEN 1")
}
//Track Events
analytics.track {
name = EVENT.BUTTON_CLICKED
put(EVENT.LABEL, button.toString())
put(EVENT.DATETIME, now())
}
//Crash Report
analytics.track {
name = EventName.EXCEPTION
EventName.STACK_TRACE to extractStackTraceInfo(throwable)
EventName.MESSAGE to throwable.message.toString()
EventName.CAUSE to throwable.cause.toString()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment