gpt4 book ai didi

javascript - 将 mixpanel 与 angular.js 结合使用

转载 作者:行者123 更新时间:2023-11-28 07:49:15 25 4
gpt4 key购买 nike

如何在 SPA 中使用 mixpanel?我想跟踪用户创建的一些事件。当用户第一次打开页面时,会向他提供随机生成的 ID。登录后执行此操作。

mixpanel.alias(data.id);
mixpanel.track('Sign In', {
'Email': response.data.email
});

user.setCurrent(data);

在 user.setCurrent 函数中我这样做:

mixpanel.identify(data.id);

但是在我的 mixpanel 帐户中,随机 ID 仍然提供给用户吗?我应该怎样做才能防止这种情况发生?

最佳答案

使用mixpanel.identify doesn't actually change the ID Mixpanel uses :

On the signup confirmation page, you call mixpanel.alias("john@hotmail.com"). This doesn't actually change his ID - he is still being identified using the random ID we originally assigned him.

您可以做的是将数据库中使用的 ID 添加到 Mixpanel Person,就像您目前处理电子邮件一样。然后配置 Mixpanel UI 以在报告中显示该列。

mixpanel.track('Sign In', {
'Email': response.data.email,
'UserId': response.data.id
});

关于javascript - 将 mixpanel 与 angular.js 结合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27057170/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com