Last active
January 18, 2021 21:19
-
-
Save amsterdatech/5c36b7432ae58cadf0ed5a04ae7cf9fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**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