Fix Mixpanel distinct_id for anonymous events
This PR adds support for anonymous Mixpanel events by allowing the distinct_id property to be empty, as documented by Mixpanel:
If the event is not associated with any user, set distinct_id to the empty string. Events with an empty distinct_id will be excluded from all behavioral analysis.
Before this PR (when distinct_id is empty):
After this PR:
Testing
Include any additional information about the testing you have completed to ensure your changes behave as expected. For a speedy review, please check any of the tasks you completed below during your testing.
- [x] Added unit tests for new functionality
- [x] Tested end-to-end using the local server
- [ ] [If destination is already live] Tested for backward compatibility of destination. Note: New required fields are a breaking change.
- [ ] [Segmenters] Tested in the staging environment
- [ ] [Segmenters] [If applicable for this change] Tested for regression with Hadron.
Hi @brennan - this is an external PR for an internally built Destination. Can you triage please?
Hi @nunofgs , Apologies for the crazy delay with this PR. I was on extended leave and am back now. Looks like this PR fell through the cracks.
Is it still something you'd like progressed?
If so can you help me understand the implications of deploying this change?
- If we pass an empty string for the distinct_id, will is suddenly result in anonymous user profiles showing up in customer's Mixpanel instances?
- If so:
- Which identifier will these anonymous profiles have?
- Will deploying this change affect the customer's analytics in any way?
- Will there be any other impact of this change to customers who have been using Segment and Mixpanel in this way for the last few years?
This PR might fix a bug - however it's important to understand if customers have become used to, or rely on their data being collected in this way now. If we fix this bug, might it cause issues for some customers?
I'm keen to get your thoughts on this.
Kind regards, Joe
hi @nunofgs just following up on this - do you still want to progress this PR?
hi @spjtls9 - I wonder if you could take a look at this PR from @nunofgs please? It's a very small change, but it would be great to have your sign off on it.
Hi Joe! Sorry I missed the notification on this thread.
If so can you help me understand the implications of deploying this change?
I have no affiliation with Mixpanel so I'm probably not qualified to answer. Very valid questions though! I simply encountered this bug when attempting to send an anonymous event to Mixpanel.
This PR might fix a bug - however it's important to understand if customers have become used to, or rely on their data being collected in this way now. If we fix this bug, might it cause issues for some customers?
Hyrum's Law indeed. Worth checking with the Mixpanel team for sure.
I'll make the requested change by @spjtls9 👍
Hi @nunofgs PR deployed.