ios - Flurry 事件根本不显示

标签 ios objective-c events flurry

我想在我的应用程序中添加一些分析功能,因此我在 Flurry 上创建了一个帐户并将他们的 SDK 添加到我的项目中。然后我记录了一些事件,正常事件和定时事件。

到这里为止没什么特别的 :) 但即使在 2 天之后,我也无法在 Flurry 的仪表板中看到任何这些事件。我可以看到 session 数,所以我猜我的应用程序实际上正在发送一些东西。但是没有事件。

有什么想法吗?我没有对代码做任何奇怪的事情,我用我的 ID 注册(根据我之前说的,这是正确的)

[FlurryAnalytics startSession:flurryKey];

并记录事件使用:

[FlurryAnalytics logEvent:@"MyEvent"];

最佳答案

除了设置之外,了解 Flurry 如何记录事件也很重要。感谢一些评论,我在 Debug模式下运行了一些测试。您通过以下方式打开它:

[Flurry setDebugLogEnabled:YES];

当我的应用程序启动时,它会设置用户 ID 和一些 pageView 日志记录。这是日志输出:

    2013-05-27 12:19:00.636 MyApp[8492:907] Flurry: Starting session on Agent Version [115] 
    2013-05-27 12:19:00.659 MyApp[8492:907] Flurry: setUserID[<cut>]
    2013-05-27 12:19:00.684 MyApp[8492:120b] FlurrySession: Add session with startTime[2013-05-27 15:46:22 +0000] to saved sessions
    2013-05-27 12:19:00.704 MyApp[8492:120b] FlurrySession: Add crashed former session
    2013-05-27 12:19:00.713 MyApp[8492:120b] FlurrySession: Event logging enabled[1]
    2013-05-27 12:19:00.714 MyApp[8492:120b] FlurrySession: Session reports on close enabled[1]
    2013-05-27 12:19:00.715 MyApp[8492:120b] FlurrySession: Session reports on pause enabled[0]
    2013-05-27 12:19:00.716 MyApp[8492:120b] FlurrySession: Crash reporting enabled[0]
    2013-05-27 12:19:00.717 MyApp[8492:120b] FlurrySession: set pushToken [(null)], _pushToken = [(null)]
    2013-05-27 12:19:00.719 MyApp[8492:907] FlurryPageViewDelegate: delegate[(null)] created
    2013-05-27 12:19:00.720 MyApp[8492:907] FlurryPageViewDelegate: delegate[(null)] created
    2013-05-27 12:19:00.736 MyApp[8492:120b] FlurrySession: Initialized session from scratch with startTime[2013-05-27 16:19:00 +0000]
    2013-05-27 12:19:00.737 MyApp[8492:120b] FlurrySession: Created active session with API[<cut>]
    2013-05-27 12:19:00.738 MyApp[8492:120b] FlurrySession: Session reports on close enabled[1]
    2013-05-27 12:19:00.739 MyApp[8492:120b] FlurrySession: Session reports on pause enabled[1]
    2013-05-27 12:19:00.740 MyApp[8492:120b] FlurrySession: Event logging enabled[1]
    2013-05-27 12:19:00.741 MyApp[8492:120b] FlurrySession: Crash reporting enabled[0]
    2013-05-27 12:19:00.742 MyApp[8492:120b] FlurrySession: Sending sessions to server, include current NO
    2013-05-27 12:19:00.763 MyApp[8492:120b] FlurrySession: Initial timestamp[2013-02-20 00:46:06 +0000] from saved source
    2013-05-27 12:19:00.780 MyApp[8492:907] FlurryPageViewDelegate: delegate[(null)] created
    2013-05-27 12:19:01.192 MyApp[8492:120b] Flurry: start background task
    2013-05-27 12:19:01.202 MyApp[8492:120b] FlurrySession: Scheduled send 1 session(s).
    2013-05-27 12:19:01.215 MyApp[8492:120b] FlurrySession: Set userID[<cut>]
    2013-05-27 12:19:01.217 MyApp[8492:120b] FlurrySession: dealloc session
    2013-05-27 12:19:04.857 MyApp[8492:907] FlurrySession: networkStatusChanged to  reachable
    2013-05-27 12:19:05.616 MyApp[8492:907] Flurry: HTTP connection delegate received response[<NSHTTPURLResponse: 0x1c5a1310>]
    2013-05-27 12:19:05.624 MyApp[8492:7f03] FlurrySession: async http response code: 200, id [D1038462-66E2-48AE-8304-83A24B0E26EB]
    2013-05-27 12:19:05.634 MyApp[8492:7f03] Flurry: stop background task

Flurry 确实会自动发送初始 session 设置,因此您将在分析页面上看到 session (上面的部分,异步 http 响应代码:200 为成功)。你会注意到它说添加崩溃了前一个 session 。这是因为我在 XCode 中单击了停止并终止了该应用程序。这不允许 Flurry 记录任何事件!它显示记录的事件,但没有安排发送 session :

    2013-05-27 12:19:41.184 MyApp[8492:aa07] FlurrySession: Recording event eventName[Doc Save] with parameters[{myparams = "xyz";
    }] complete

您需要先点击设备上的主页按钮,让 Flurry 真正发送记录的事件。单击主页后,您将在日志中看到:

    2013-05-27 12:21:15.884 MyApp[8492:a30f] FlurrySession: Pause session with pauseTime[2013-05-27 16:21:15 +0000]
    2013-05-27 12:21:15.885 MyApp[8492:a30f] FlurrySession: Finish session with endTime[2013-05-27 16:21:15 +0000]
    2013-05-27 12:21:15.887 MyApp[8492:a30f] FlurrySession: ending all unterminated timed events with _endTime[2013-05-27 16:21:15 +0000]...
    2013-05-27 12:21:15.890 MyApp[8492:a30f] FlurrySession: ...finished ending un-ended timed events.
    2013-05-27 12:21:15.891 MyApp[8492:a30f] FlurrySession: Sending sessions to server, include current YES
    2013-05-27 12:21:15.900 MyApp[8492:a30f] FlurrySession: Initial timestamp[2013-02-20 00:46:06 +0000] from saved source
    2013-05-27 12:21:15.914 MyApp[8492:a30f] Flurry: start background task
    2013-05-27 12:21:15.919 MyApp[8492:a30f] FlurrySession: Scheduled send 1 session(s).
    2013-05-27 12:21:16.729 MyApp[8492:907] Flurry: HTTP connection delegate received response[<NSHTTPURLResponse: 0x1c5ac0b0>]
    2013-05-27 12:21:17.090 MyApp[8492:9c0b] FlurrySession: async http response code: 200, id [BB7CE5C1-D9C4-412F-9A41-6A838174B8FC]
    2013-05-27 12:21:17.293 MyApp[8492:9c0b] Flurry: stop background task

然后您可以在 XCode 中使用 Stop 终止应用

关于ios - Flurry 事件根本不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9821996/

相关文章:

ios - 如何在 iMessage 扩展中将事件发送到 Firebase Analytics

java - 将鼠标事件处理从 Java 1.5 更改为 1.6

python - 在一个函数中创建列表,然后在 python (pythonista ios) 中的另一个函数中使用它

objective-c - 随机 C/Objective-C 问题

ios - IOS中带有完成 block 的后台任务

iphone - 确定是否在 webView 上单击了链接 - iPhone

javascript - 发出 "exit"事件时执行异步代码

ios - 调整容器中页面 View 的大小

ios - NSTimer 无效不起作用

ios - 父子类之间的弱引用