-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
I was following the setup docs for session tracking on Android here
This is the suggested code for basic setup of session tracking:
import com.amplitude.android.Amplitude
import com.amplitude.android.Configuration
import com.amplitude.android.plugins.SessionReplayPlugin
// Initialize Amplitude Analytics SDK instance
val amplitude = Amplitude(Configuration(
apiKey = API_KEY,
context = applicationContext,
defaultTracking = DefaultTrackingOptions(sessions = true),
))
// Create and Install Session Replay Plugin
// Recording will be handled automatically
val sessionReplayPlugin = SessionReplayPlugin(sampleRate = 1.0)
amplitude.add(sessionReplayPlugin)
// Send replay data to the server
amplitude.flush()
However DefaultTrackingOptions has been deprecated, the correct way seems to now be
val amplitude = Amplitude(
Configuration(
apiKey = apiKey,
context = context,
serverZone = ServerZone.EU,
autocapture = setOf(AutocaptureOption.SESSIONS)
)
)
val sessionReplayPlugin = SessionReplayPlugin(
sampleRate = 1.0
)
amplitude.add(sessionReplayPlugin)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels