analytics-react-native icon indicating copy to clipboard operation
analytics-react-native copied to clipboard

Amplitude sessions abnormally long on Android

Open jetaix opened this issue 8 months ago • 0 comments

We’ve noticed an issue with our session length on Android, which looks significantly high (around 25 minutes) compared to iOS and web, which is around 2 minutes.

Plugins @segment/analytics-react-native-plugin-amplitude-session

On Amplitude we use the default "Session definition"

Is anyone else experiencing this?

Amplitude chart: Image

User Session exemple:

Image

We’re starting an investigation on our end.

Regarding the code, the issue could be related to the setTimeout (on Android), which may pause when the app is sent to the background and resume when it returns to the foreground and never reseted. This behavior could cause an abnormally long session duration

We use

    "react-native": "0.76.7",
    "@segment/analytics-react-native": "^2.20.3",
    "@segment/analytics-react-native-plugin-amplitude-session": "^0.4.0",
    "@segment/sovran-react-native": "^1.1.3",

jetaix avatar Mar 13 '25 12:03 jetaix