Inactivity Handling

Users may walk away from their device or fail to close the experience. It is best practice for Metalitix to stop recording data to prevent negative influence on some metrics.

By default, Metalitix will automatically stop recording session metrics after 2 minutes of user inactivity (120,000 milliseconds).

val loggerOptions = MetalitixLoggerOptions(
    inactivityInterval = 120000,  // Default
)
logger = Metalitix.getLogger(context, apiKey, loggerOptions)

The Metalitix Logger also provides functions for listening into inactivity events.

FunctionDescription

logger.addInactivityListener (OnInactivityListener)

Adds a callback (class that implements OnInactivityListener method) when a session is automatically stopped due to inactivity.

logger.removeInactivityListener (OnInactivityListener)

Removes a previously added callback (class that implements OnInactivityListener method).

logger.clearInactivityListeners()

Removes all inactivity callbacks.

Last updated