matomo-org / matomo-sdk-android

SDK for Android to measure your apps with Matomo. Works on Android phones, tablets, Fire TV sticks, and more!
BSD 3-Clause "New" or "Revised" License
388 stars 162 forks source link

HeartBeat functionality #233

Open d4rken opened 5 years ago

d4rken commented 5 years ago

https://developer.matomo.org/guides/tracking-javascript-guide#accurately-measure-the-time-spent-on-each-page

See #201

Mr-Norrell commented 5 years ago

Thanks @d4rken. To justify this need more, I just wanted to point out our situation, which I think is a common case. In live-streaming applications like ours, users mostly will exit the app from the player page. Thus we have no duration for their last action, which in our case is watching a stream. Comparing to our web platform, we can see a notable difference in users' visit duration, which we believe is because of this very issue.

d4rken commented 5 years ago

I guess we could introduce a function like Tracker.enableHeartBeat(timeInMiliseconds), not sure when one would best call this in an Android app like yours or when to disable it hm...

voxspox commented 4 years ago

What about just using the fact that we know when the app has focus. If the app come to foreground a session starts and if the app goes to background a session ends. In between we can be sure the user is viewing a screen and thus the timer for this screen should run.

RubenKoers commented 4 years ago

The enableHeartBeatTimer would be also interesting for our application as we have many users just opening a single page before closing the app again. Is there any support for this functionality in IOS or Android yet?