react-native-mixpanel icon indicating copy to clipboard operation
react-native-mixpanel copied to clipboard

Allow `timeEvent` to be ended with `trackWithProperties` (or even better, deprecate `trackWithProperties` altogether and use `track`)

Open dwilt opened this issue 5 years ago • 1 comments

According to the documentation for web, it looks like you can end the timeEvent along with custom properties:

mixpanel.time_event('Registered');
mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21});

However, in the react native version, if you try and end a timeEvent with trackWithProperties:

Mixpanel.timeEvent('some event);
// some async operation taking time
Mixpanel.trackWithProperties('some event', { name: 'Dan' });

the event gets logged in Mixpanel but the duration field is blank. If you end the timeEvent with track instead of trackWithProperties:

Mixpanel.timeEvent('some event);
// some async operation taking time
Mixpanel.track('some event');

the duration field is in the event in Mixpanel but you don't get the other properties you passed.

The underlying question really is, why the differentiation between track and trackWithProperties? Why not, like the web version, just use track and it can take an optional object of parameters?

dwilt avatar Jun 06 '19 20:06 dwilt

+1

yogeshchoudhary147 avatar Oct 03 '19 06:10 yogeshchoudhary147