I try to remove a property for a user using mixpanel JavaScript API. As I can see, there is only a method set, but no method unset. I tried to set the property with undefined or null but when I do so, the property still exists with no value. I would like to totally remove it as we can do it with the mixpanel interface. Is that possible?
Thanks for your help!
Some code:
// Let set the property 'foo' with a value 'bar' to the current user
mixpanel.people.set("foo", "bar");
// Now, let unset this proprety
// Oops, there is no method unset...
// Let's try something else
mixpanel.people.set("foo"); // nop...
mixpanel.people.set("foo", undefined); // nop...
mixpanel.people.set("foo", null); // the value is now empty but the property still exists
The Android MixPanel library (v4.6.4) has an unset(String)
method for people properties, perhaps the JavaScript API has an equivalent, which I would assume to be:
mixpanel.people.unset("foo");
Perhaps this did not exist back in August.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With