Skip to content

Multiple Start Session/ End Session events with 0/1 second duration #266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
vladyslavbaranov25 opened this issue Apr 17, 2025 · 0 comments

Comments

@vladyslavbaranov25
Copy link

vladyslavbaranov25 commented Apr 17, 2025

SDK Version and configuration details

1.20.2

Amplitude(
        Configuration(
            apiKey = apiKey,
            context = context.applicationContext,
            minIdLength = 1,
        )

Expected Behavior

Start Session and End Session events should be tracked when the application moves to the foreground and background, respectively.

Current Behavior

Start Session, End Session events seems to be tracked every time the application is created and our app initialises analytic, every time some worker wakes up application in the background Amplitude tracks Start Session, End Session events with same timestamps
Image

Possible Solution

As a temporary workaround, I disabled automatic session tracking in the Amplitude SDK by removing AutocaptureOption.SESSIONS from the autocapture configuration:

Amplitude(
  configuration = Configuration(
      autocapture = emptySet()
   ) 
)

A similar issue also existed in the old, now-deprecated Amplitude SDK: amplitude/Amplitude-Android#397

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant