使用 mixpanel JavaScript 客户端取消设置人员属性

art*_*hur 5 javascript mixpanel

我尝试使用 mixpanel JavaScript API 删除用户的属性。正如我所见,只有一个方法集,但没有未设置的方法。我试图用 undefined 或 null 设置属性,但是当我这样做时,该属性仍然存在,没有值。我想完全删除它,因为我们可以使用 mixpanel 界面来完成。那可能吗?

谢谢你的帮助!

一些代码:

// 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
Run Code Online (Sandbox Code Playgroud)

Fif*_*eep 2

Android MixPanel 库(v4.6.4)有一个unset(String)用于人员属性的方法,也许 JavaScript API 有一个等效的方法,我假设是:

mixpanel.people.unset("foo");
Run Code Online (Sandbox Code Playgroud)

也许这在八月份还不存在。