-
Notifications
You must be signed in to change notification settings - Fork 139
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
Calling posthog.identify() starts a new session #247
Comments
Hey @krschacht! Thanks for reporting. I can confirm this is the case. For our own team: This was moved here but I'm not actually sure it belongs in
|
Upon actually looking a bit into this I think it might be related to our duplicate persons problem. |
The sessions query indeed aggregates based on distinctId not personId. Proof: https://github.com/PostHog/posthog/blob/master/ee/clickhouse/sql/sessions/list.py#L95-L97 Meta-issue required to be solved here is what even is a session and what usecases does it serve: PostHog/posthog#4884 |
Got it, I have noticed this duplicate person problem too. In case it's helpful, I resolved both these issues internally for myself with some complicated SQL. As you are trying to resolve this, it could help. This is very far from a PR so just some raw SQL that might be helpful:
And then:
Finally:
This doesn't fix it within the app myself, but I have some custom dashboards that show me correct sessions thanks to these queries. |
This issue hasn't seen activity in two years! If you want to keep it open, post a comment or remove the |
This issue was closed due to lack of activity. Feel free to reopen if it's still relevant. |
Bug description
When a session is being recorded with a series of events, as soon as the user logs in (and posthog.identify() is called with their user_id) the logs begin a new session for this user.
Expected behavior
Conceptually, I expect the data model of a "session" with a unique session_id to be one continuous sequence of actions without a 30 minute gap of inactivity. Here is a screenshot of a test user. This is one session and you can see the moment the user_id was passed it started grouping those events as a new session.
https://share.getcloudapp.com/jkuPKjpn
How to reproduce
Environment
Thank you for your bug report – we love squashing them!
The text was updated successfully, but these errors were encountered: