Skip to main content

Activity history

Shake tracks user's interaction with your app, their network traffic, notifications, logs and system events, and automatically attaches all of those to the ticket.

Setup

User actions

Shake automatically observes taps made on your app's UI elements.

note

This feature is disabled for apps built with Jetpack Compose.

Network traffic

If you want to receive users' network traffic logs, add this line to your OkHttpClient:

App.kt
val okHttpClient = OkHttpClient()
.newBuilder()
.addInterceptor(ShakeNetworkInterceptor())
.build()

If you don’t use OkHttpClient, use this method to forward requests to Shake:

App.kt
Shake.handleNetworkRequest(
connection: HttpURLConnection,
requestBody: String,
responseBody: String)

You can log your own custom network requests too:

App.kt
val networkRequestBuilder = NetworkRequestBuilder()
.setUrl("https://api.github.com")
.setMethod("POST")
.setRequestHeaders(requestHeaders)
.setRequestBody(requestBody)
.setTimestamp(Date())
Shake.insertNetworkRequest(networkRequestBuilder)

System events

System events - also known as app lifecycle events - are tracked automatically and require no additional setup.

Screen changes

Screen changes are tracked automatically and require no additional setup.

note

The SDK will collect just changes of Android Activities, adding, removing or replacing Fragments inside an Activity is not tracked.

Notifications

In order for Shake to track notifications throughout your app, add this line where appropriate:

App.kt
startActivity(Intent("android.settings." +
"ACTION_NOTIFICATION_LISTENER_SETTINGS"))
note

This starts the notification listener service, which will require users to grant notification access the first time they open your app.

If you want Shake to manually handle notification tracking, use this method instead:

App.kt
Shake.insertNotificationEvent(
notificationTitle: String,
notificationDescription: String
)

Custom logs

You can add your own logs to Activity history too:

App.kt
Shake.log(LogLevel.INFO, "Log message goes here!")

You have these log levels at your disposal:

App.kt
LogLevel.VERBOSE
LogLevel.DEBUG
LogLevel.INFO
LogLevel.WARN
LogLevel.ERROR

Console logs

Console logs are recorded automatically and require no additional setup. If you want to disable this feature use the method below:

App.kt
Shake.getReportConfiguration().isConsoleLogsEnabled = false

Disable

Activity history is enabled by default, use the method below to disable it altogether:

App.kt
Shake.getReportConfiguration().isEnableActivityHistory = false