Skip to main content

Events Automatically Tracked

These events are tracked by default (no code required):
Event NameDescription
Screen ViewedAutomatically logs activity-level screen views (e.g., HomeActivity, LoginActivity).
Fragment ViewedLogs views for individual fragments within an activity, e.g., ProductListFragment.
Tab ViewTracks user switching between bottom or custom tab components (e.g., Home, Cart, Profile).
Drawer ViewTracks drawer open/close events, useful for identifying navigation engagement.
DialogTracks dialog open/close events (e.g., alerts, pop-ups, confirmation dialogs)
App in ForegroundFires when the app enters the foreground (e.g., user opens or resumes the app).
App LanguageTracks the app’s current language on first launch or when changed by the user. Useful for understanding localization trends.
Splash TimeCaptures time spent on the splash screen to help analyze loading performance.

Manual Tracking (Fallback)

If auto-tracking fails on certain devices or flows, use the following manual methods to ensure data is captured.

Screen Viewed

Call this method in onCreate().
SetAnalytics.getInstance()
  .setActivityEvent(
    screenName: String,
    screenClass: Activity
  )
Property KeyDescriptionExample ValueRequired
screenNameDisplay name of the screenMain ActivityYes
screenClassFull class name of the activity screencom.MainActivityYes
Example of Screen Viewed
SetAnalytics.getInstance()
    .setActivityEvent(
        "MainActivity",    // screenName
        this@MainActivity // screenClass
    )

Fragment Viewed

Call this method in onCreateView().
SetAnalytics.getInstance()
  .setFragmentEvent(
    screenName: String,
    screenClass: Activity,
    fragmentClass: Fragment,
    fragmentIndex: Int
  )
Property KeyDescriptionExample ValueRequired
screenNameDisplay name of the screenHomeYes
screenClassActivity class hosting the fragmentcom.mainActivityOptional
fragmentClassFully qualified class name of fragmentcom.homeYes
fragmentIndexPosition index of the fragment within the stack0Yes
Example of Fragment Viewed
activity?.let {
    SetAnalytics.getInstance()
        .setFragmentEvent(
            "fragmentName",    // screenName
            it,                // screenClass
            this@FragmentOne,  // fragmentClass
            0                  // fragmentIndex
        )
}

Tab View

SetAnalytics.getInstance()
  .setTabEvent(
    tabName: String,
    tabIndex: Int,
    screenClass: Activity,
    fragmentClass: Fragment ?
  )
Property KeyDescriptionExample ValueRequired
tabNameName or label of the tab that was selectedTab 1Yes
tabIndexIndex of the tab that was selected1Yes
screenClassFull class name of the activity screencom.MainActivityYes
fragmentClassName of the fragment (if any) where the drawer is hostedcom.FragmentOneOptional
Example of Tab View
SetAnalytics.getInstance()
  .setTabEvent(
    "tabName",          // tabName
    1,                  // tabIndex
    this,               // screenClass
    this@FragmentOne,   // fragmentClass
  )

Drawer

SetAnalytics.getInstance()
  .setDrawerEvent(
    screenClass: Activity,
    action: String
  )
Property KeyDescriptionExample ValueRequired
drawerNameDescriptive name of the drawer being interacted withMenu / ProfileOptional
actionIndicates whether the drawer was opened or closedopen / closeYes
screenClassFull class name of the activity screencom.mainActivityYes
fragmentClassName of the fragment (if any) where the drawer is hostedcom.homeOptional
Example of Drawer
SetAnalytics.getInstance()
    .setDrawerEvent(
        this@MainActivity, // screenClass
        "open"             // action (open or close)
    )

Dialog

SetAnalytics.getInstance()
  .setDialogEvent(
    dialogName: String,
    action: String,
    screenClass: Activity
  )
Property KeyDescriptionExample ValueRequired
dialogNameName or identifier of the dialog shownAlert DialogOptional
actionDialog interaction typeopen / closeYes
screenClassFull class name where dialog appearedcom.homeActivityYes
Example of Dialog
SetAnalytics.getInstance()
  .setDialogEvent(
    "Alert Dialog",    // dialogName
    "open",            // action (open or close)
    this@MainActivity  // screenClass
  )

App in Foreground

// Some Code
Property KeyDescriptionExample ValueRequired
eventNameStatic identifier for this eventappBackgroundYes
screenNameDisplay name of the last visible screen before app was backgroundedHomeYes
screenClassClass name of the activity visible before the app moved to backgroundcom.mainActivityYes
fragmentClassFragment class visible (if any) when app moved to backgroundcom.homeOptional

App Language

SetAnalytics.getInstance()
  .setAppLanguage(
    activity: Context,
    languageCode: String
  )
Property KeyDescriptionExample ValueRequired
screenClassDisplay name of the screenthisYes
languageCodeISO language codeenYes
Example of App Language
SetAnalytics.getInstance()
  .setAppLanguage(
    this, // screenClass
    "en" // languageCode
  )

Splash Time

Call this method in onCreate().
SetAnalytics.getInstance()
  .setSplashTimeEvent(
    time: Long
  )
Property KeyDescriptionExample ValueRequired
timeDuration the splash screen was shown (in milliseconds)0.02Yes
Example of Splash Time
SetAnalytics.getInstance().setSplashTimeEvent(2000)