gpt4 book ai didi

java - Spring Boot Mixpanel : How to set properties to User profile?

转载 作者:行者123 更新时间:2023-11-30 05:26:38 34 4
gpt4 key购买 nike

现在我正在编写一个应用程序,使用 Spring Boot 将事件发送到 Mixpanel,目前只能设置事件属性,而不能设置用户配置文件。

        MessageBuilder messages = new MessageBuilder("my token");
JSONObject eventProp = new JSONObject();
eventProp.put("City", "Phnom Penh");
JSONObject event = messages.event("joe@gribbl.com", "Logged In", eventProp);

ClientDelivery delivery = new ClientDelivery();
delivery.addMessage(event);

MixpanelAPI mixpanel = new MixpanelAPI();
mixpanel.deliver(delivery);

如何设置该用户配置文件的属性?

最佳答案

您可以通过 messageBuilder.set 更新/设置人员的属性

        MessageBuilder messages = new MessageBuilder("my token");
// prepare event properties
JSONObject eventProp = new JSONObject();
eventProp.put("City", "Phnom Penh");
JSONObject event = messages.event("joe@gribbl.com", "Logged In", eventProp);

// prepare people properties
JSONObject peopleProp = new JSONObject();
peopleProp.put("Full Name", "Cheav Sovannarith");
JSONObject people = messages.event("joe@gribbl.com", peopleProp);

ClientDelivery delivery = new ClientDelivery();
delivery.addMessage(event);
delivery.addMessage(people);

MixpanelAPI mixpanel = new MixpanelAPI();
mixpanel.deliver(delivery);

了解更多 developer.mixpanel.com

关于java - Spring Boot Mixpanel : How to set properties to User profile?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58444107/

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