posthog-js icon indicating copy to clipboard operation
posthog-js copied to clipboard

feat(identify): disable anon_distinct_id sending

Open mariusandra opened this issue 3 years ago • 1 comments

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)

mariusandra avatar Jul 08 '22 12:07 mariusandra

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)

EDsCODE avatar Jul 22 '22 13:07 EDsCODE

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.

posthog-bot avatar Apr 05 '23 09:04 posthog-bot

This PR was closed due to lack of activity. Feel free to reopen if it's still relevant.

posthog-bot avatar Apr 13 '23 09:04 posthog-bot