我有一个包含很多模块(在 Objective-C 中)的 iOS SDK 项目。 我想开始跟踪事件以查看我的客户如何使用我们的 SDK,但我在洞察选项卡中看不到任何内容。我究竟做错了什么?
在 SDK 的入口点,我添加了这个(就在文档之后):
[Mixpanel sharedInstanceWithToken:@"myTOKEN"];
self.mixpanel.serverURL = @"https://api-eu.mixpanel.com";
[self.mixpanel track:@"Video play" properties:@{
@"genre": @"hip-hop",
@"duration in seconds": @42,
}];
我可以通过断点看到它执行的代码,但是我的见解完全是空的。
我还尝试使用无代码跟踪添加事件,虽然它看起来工作正常并且我可以连接到该应用程序,但事件没有出现在“洞察”选项卡中。
最佳答案
我认为您需要将共享实例分配给您的本地属性,如果在您发布的代码之外没有这样做的话。
[Mixpanel sharedInstanceWithToken:@"myTOKEN"];
self.mixpanel = [Mixpanel sharedInstance]; // assign here
self.mixpanel.serverURL = @"https://api-eu.mixpanel.com";
[self.mixpanel track:@"Video play" properties:@{
@"genre": @"hip-hop",
@"duration in seconds": @42,
}];
关于ios - iOS SDK 中集成的 Mixpanel 不发送事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63580096/