mixpanel-python icon indicating copy to clipboard operation
mixpanel-python copied to clipboard

`Mixpanel.alias` ignores any custom configuration

Open mskrip opened this issue 3 years ago • 2 comments

When Mixpanel.alias is used it creates it's own default Consumer instance and sends the event through it. This makes it ignore any custom configuration done on the side of a Consumer.

Usecase

The Scaling your server side tracking docs suggest implementing a custom consumer that logs the events into one file/stream and then send the events outside of main thread to not make the event sending synchronous with the application.

But since it's always a good idea to have secrets, such as Mixpanel token, in as fewer places as possible we decided to log the events with a placeholder token and replace it only before they are actually being sent to the Mixpanel servers. This approach makes it so that .alias method is not working at all.

I do get the idea that alias has to be created before any events with the new id are tracked (#7). But the current implementation is a bit too binding and unintuitive from the perspective of the library user.

mskrip avatar Apr 19 '21 12:04 mskrip

I am collecting snags like this to influence an overhaul of this library. Thank you, this is nasty and will be included.

seizethedave avatar Jun 17 '21 05:06 seizethedave

The fix #114

dcharbonnier avatar Sep 20 '22 15:09 dcharbonnier