paullangtree / analytics-issues

Automatically exported from code.google.com/p/analytics-issues
2 stars 0 forks source link

Session duration and Avg. Time on Screen is 00:00:00 if app contains single screen #720

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Name of affected component: Mobile Tracking

Name of related library and version, if applicable (e.g. Android, iOS,
Snippets, etc.):
Android, Google analytics api v4.

Issue summary:
Session duration and Avg. Time on Screen is zero if the app contains only 
single activity.

Steps to reproduce issue:
1. Integrate google analytics
2. Get valid id
3. Configure the library to report activity start/stop automatically using 
analytics.enableAutoActivityReports(context) method, or manually using 
reportActivityStart()/reportActivityStop() methods calling from onStart/onStop.
4. Open the app for ~10-20 sec and then close. Repeat 10-15 times to get 
appropriate screen views count.
5. Go to console after a day to look at reports

Expected output:
Session (Audience->Behavior->Session Duration) is not zero. Screen appears on 
Screens page (Behavior->Screens) and avg time is not zero.

Actual results:
Session duration is zero, screen doesn't appear if track start/stop manually, 
avg time for main (and single) screen is zero if track automatically.

Notes:
The onStop/onStart methods of activity are called guaranteed.

There are similar issues on stackoverflow 
(http://stackoverflow.com/questions/11050546/google-analytics-on-android-gives-a
vg-site-duration-000000, 
http://stackoverflow.com/questions/28620331/google-analytics-avg-session-duratio
n-is-000000), but there is no good answers there.

There is the following explanation about web analytic: "Session duration is the 
delta between the first and last interaction, so when a user comes to your site 
and leaves without going to any another pages (or interacting with it in some 
way), the session duration is always 0, even if they were there for several 
minutes." (http://stackoverflow.com/a/25212167/1162357). But it seems it looks 
incorrectly for mobile app which can have only single screen.

Code used for tests attached.

Original issue reported on code.google.com by vladimir...@gmail.com on 24 Aug 2015 at 3:16

Attachments: