Amplitude-Kotlin
Amplitude-Kotlin copied to clipboard
The session id value is not set
Summary
Hi, I'm trying to migrate to this brand-new SDK. However, the Session ID property is always -1 despite the following configuration:
Configuration(
apiKey = "the-key-value"
optOut = true, // Disable data collection due to GDPR (will be enabled after user consent)
context = application,
locationListening = false,
defaultTracking = DefaultTrackingOptions(
appLifecycles = false,
sessions = true,
deepLinks = false,
screenViews = false
)
)
UPD: The event stream has two groups of events: green and blue. The blue ones have a value for the Session ID set correctly, but the green ones have a -1 value.
What am I doing wrong? Or maybe I am missing something?
Hi @KChernenko, thanks for reporting the issue. Would you mind sharing the link to the event you posted?
@qingzhuozhen, can I do this via private DM?
Hi @KChernenko, it is fine to share the link here since it is behind authentication so others won't be able to access it. Or you can submit via our support if your org is a paying customer.
@qingzhuozhen okay, no problem.
This is the link: https://app.amplitude.com/analytics/betterme/project/231475/search/amplitude_id%3D752794883738
Hi @KChernenko, I found the issue. It is basically for during optOut, some logic from our lifecycle got skipped and then later optIn, the session value is not updated. This is an edge case and we are trying to figure out the best ways to solve it.
@qingzhuozhen Hi! Do you have any updates on the issue?
Hello, I think this issue affects my application as well. My amplitude setup is similar to OP's with optOut
set to true
initially and set to false later after a successful login and some conditions are met.
Steps to Reproduce:
- a current session is in progress with
optOut
set tofalse
- App is backgrounded
- Tap push notification.
- Set a user property using
amplitude.identify(identify.set(KEY, value))
Expected result: User property can now be seen on the following events.
Actual Result: User property is not attached to the events.
I can provide more information if needed.