I work on a camera app, and I'm collecting a stream of analytics events like:
- App entered foreground.
- The user took a photo.
Let's say I want to find out how long after the app enters foreground the user takes a photo. This requires me to find, for a particular photo event, the most recent foreground event that happened before the photo event, with the same device ID, and subtract the difference in timestamps between them.
Or, let's say I want to find out how many photos a user takes in a typical session, given a stream of events like:
- App entered foreground.
- User took photo.
- User took photo.
- App entered background.
This will require me to find, for a given background event, the most recent foreground event that happened before the background event, and then count how many photo events happened between these two events, all for the same device ID.
Are such types of analyses feasible and easy to do with typical analytics services like Firebase Analytics or Amplitude? Or is it easier to log this information myself in my iOS app, say by adding a field to the photo event that tracks how long it has been since the last event.
Which is simpler to do?