feat(identify): disable anon_distinct_id sending
Changes
This came from a customer request, where they identify a user as soon as they logged in. Even though no anonymous events are sent before the identify event, the $anon_distinct_id prop is still sent, and thus a new ID is associated with the user every time. That's just noise when looking at persons.
This PR adds a config send_anon_distinct_id (default: true), which can be disabled to not send $anon_distinct_id on identify.
I considered instead detecting if any events are sent by the anonymous id, and if not, automatically not sending it, but paused when I tried to start untangling how the distinct id is created and set. Afraid of making mistakes, I put this no-nonsense PR up instead.
Checklist
- [ ] Tests for new code (see advice on the tests we use)
- [ ] Accounted for the impact of any changes across different browsers
- [ ] TypeScript definitions (module.d.ts) updated and in sync with library exports (if applicable)
Just a heads up now when we make changes to posthog-js we should open tickets or note somewhere these changes should be reflected on the other client libs (android, ios)
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.
This PR was closed due to lack of activity. Feel free to reopen if it's still relevant.