-
Notifications
You must be signed in to change notification settings - Fork 336
posthog-destination: fix an issue with the tracking of anonymous users #1179
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
Conversation
d870d9d to
03f3ef5
Compare
|
This documentation video also is a good source of information on this: |
|
Thank you! this PR will enable anonymous events capture for clients that have And also improve description of We need some time to make sure that no other unwanted side effect will occur for existing clients. |
|
Thanks for taking a look. Yeah, I assumed there might be a need for additional user config options. I've never put in the work to get the stack running locally :), nor did I actually run the code in the PR locally (although I tested my research via direct REST calls to the Posthog API). LMK if there's anything I can do to help get this over the line. |
|
Hey @absorbb just wanted to check in and see if there's anything else I can do to get this over the finish line. Thanks! |
|
@jspizziri We still need to restore compatibility with the current state of config and introduce an additional configuration option. I’ll be able to work on that next week. If you’re able to handle this part in the meantime, that would be helpful. Also, do you need this on Cloud only, or for self-hosted as well? |
…ntrols enables sending events from anonymous users. While 'enableAnonymousUserProfiles' controls whether Jitsu needs to create Person Profiles for anonymous users
|
@jspizziri could you please allow me to push to your branch? |
|
@absorbb just sent you R/W to our repo. |
|
I introduced the Please make sure that i haven't broke your intended changes. I also performed testing on our test system with all config combinations. From my point of view - everything is ok and that one also is ready to be on the cloud tomorrow. |
|
@absorbb it looks like it will still function the way I'd expect if the |
|
on the cloud and in |
jitsucom#1179) * posthog-destination: fix an issue with the tracking of anonymous users * posthog-destination: introduce 'sendAnonymousEvents' property that controls enables sending events from anonymous users. While 'enableAnonymousUserProfiles' controls whether Jitsu needs to create Person Profiles for anonymous users
Currently, it seems to us that there are a few issues with the tracking of anonymous users. First I want to specify that the term "anonymous" is overloaded here. There are 3 categories of events, and I'll specify some terms I'll refer to them by to keep them straight:
Anonymous/Unidentified- Events that occur before a user has identified themselves, which should have some sort ofanonymousIdassociated with them. Importantly, we do intend to merge these events into an identified user/"Person" at some point.Identified- Events that occur after a user has identified themselves.Anonymous/Anonymous- Posthog "anonymous" events which are intended never to have identifiable information associated with them. Importantly, these events should never be merged into a "Person" record.When
Enable Anonymous User ProfilesIs EnabledWhen this setting is enabled, over multiple sessions where the user starts as
Anonymous/Unidentifiedand then becomesIdentified, currently, you'll end up with duplicate "person" records in Posthog for that user. While there is an alias event that connects the two of them together, they don't get merged into a single record as they should properly be. Therefore, overtime you accumulate a large set of distinct "Person" records in Posthog all containing theAnonymous/Unidentifiedevent history of a user prior to identification, with aliases back to the true identity with the actualIdentifiedevents.By default, all Posthog events are associated with a person profile. Therefore,
identifyshould not be called for aAnonymous/Unidentifieduser, but rather only called for the actualIdentifieduser and then immediately aliased to theAnonymous/Unidentifiedusers' previousdistinctId. This merges all the users' data (bothAnonymous/Unidentified&Identified) into a single record.When
Enable Anonymous User ProfilesIs DisabledIf you disable this setting, no events are sent to posthog at all, whereas what I would expect would happen is to have
Anonymous/Anonymousevents sent to Posthog.