What is a good way to track background events in Android without inflating session numbers?

Right now I use Flurry for all my applications in application analytics. I'm starting to add features that include services and broadcast receivers. I want to track events inside these components, but I do not 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 the session. In fact, I want people using new features to increase the number of sessions.

One idea that I think of is to convey the parameters of a passive event in my intentions for Acts. Then enable those that have all the active events that are typically sent to Flurry for this session.

Is this a good approach? Is there a better way with Flurry or even a better tool?

Update

I got a response from Flurry, but not the one I was hoping for

We currently do not support sending events from BroadcastReceiver to Android. Events must be logged within the session, and sessions are context sensitive. Sorry for the inconvenience.

+4
source share
1 answer

My recommendation would be to have a Service or IntentService that you can call with event data that you want to send to Flurry. The service can cache, summarize, queue and do everything you need before sending data, and this will not depend on the action taken.

You still need to start a session, but you can just have one long session instead of starting a new one for each event.

0
source

Source: https://habr.com/ru/post/1400077/


All Articles