Mixpanel-Unity-CSharp icon indicating copy to clipboard operation
Mixpanel-Unity-CSharp copied to clipboard

Super properties now functions instead of constant values

Open golergka opened this issue 10 years ago • 3 comments

Since they are sent on every event, it doesn't make sense to save them as constant values — better to save delegates that determine their values.

golergka avatar Feb 26 '15 13:02 golergka

Hey, thanks for the pull request! I think that your change makes a lot of sense for experienced C# programmers, but I worry that it makes the API more difficult to use than necessary for more novice Unity programmers. Also, when originally developing this API I tried to make it match the existing Mixpanel APIs for other platforms. Do you know if there's any precedent set by other Mixpanel APIs for treating super properties as callback methods?

waltdestler avatar Feb 26 '15 18:02 waltdestler

No, I didn't research Mixpanel's APIs for other platforms at all, tbh. However, I the only "advanced" feature here is lambda syntax, and I think that it should be more or less obvious for C# programmer of any level from the provided example.

golergka avatar Feb 27 '15 10:02 golergka

How about a solution that supports both ways of setting super properties? For example, we could have a SuperPropertiesCallbacks in addition to the regular SuperProperties, and the properties from both would simply be merged before sending to Mixpanel?

This way we can support both styles, and it has the added bonus of staying backwards-compatible with existing code.

Thoughts?

waltdestler avatar Feb 27 '15 18:02 waltdestler