Right now I use Flurry for all my in app analytics needs. I'm starting to add features involving services and broadcast receivers. I want to track events within these components, but I don't want to start a new session in Flurry based on these passive events. From what I can tell, the only way to track events in Flurry is to track them between the start and end of a session. Essentially I want to see if people using the new features boost my session count.
现在我使用Flurry来满足我所有的应用分析需求。我开始添加涉及服务和广播接收器的功能。我想跟踪这些组件中的事件,但我不想基于这些被动事件在Flurry中启动新会话。据我所知,在Flurry中跟踪事件的唯一方法是在会话的开始和结束之间跟踪它们。基本上我想知道使用新功能的人是否会增加我的会话数。
One idea I'm thinking about is passing the passive event parameters in my intents to the Activities. Then including those with every active event that normally gets sent to Flurry for that session.
我正在考虑的一个想法是将我的意图中的被动事件参数传递给活动。然后包括那些通常被发送到Flurry进行该会话的每个活动事件。
Is this a good approach? Is there a better way with Flurry or even a better tool?
这是一个好方法吗? Flurry或更好的工具有更好的方法吗?
Update
更新
I got a response from Flurry, but not the one I was hoping for
我收到Flurry的回复,但不是我希望的回复
We currently do not support the sending of events from within a BroadcastReceiver on Android. The events must be logged from within the confines of a session, and the sessions are dependent on Contexts. Sorry for the inconvenience.
我们目前不支持在Android上的BroadcastReceiver中发送事件。必须在会话的范围内记录事件,并且会话依赖于上下文。抱歉给你带来不便。
1 个解决方案
#1
0
My recommendation would be to have a Service or an IntentService that you can call with event data that you want to send to Flurry. The service could cache, summarize, queue and do whatever you need before sending the data and it wouldn't depend on an Activity running.
我的建议是拥有一个服务或IntentService,您可以使用要发送到Flurry的事件数据来调用它。在发送数据之前,该服务可以缓存,汇总,排队和执行您需要的任何操作,并且它不依赖于正在运行的Activity。
You would still need to start a session but you could just have one long session instead of starting a new one for each event.
您仍然需要启动一个会话,但您可以只有一个长会话,而不是为每个事件启动一个新会话。
#1
0
My recommendation would be to have a Service or an IntentService that you can call with event data that you want to send to Flurry. The service could cache, summarize, queue and do whatever you need before sending the data and it wouldn't depend on an Activity running.
我的建议是拥有一个服务或IntentService,您可以使用要发送到Flurry的事件数据来调用它。在发送数据之前,该服务可以缓存,汇总,排队和执行您需要的任何操作,并且它不依赖于正在运行的Activity。
You would still need to start a session but you could just have one long session instead of starting a new one for each event.
您仍然需要启动一个会话,但您可以只有一个长会话,而不是为每个事件启动一个新会话。