Google Analytics on Android gives avg session duration: 00:00:00

I use google analytics on Android and it gives me a lot of avg session duration: 00:00:00

note that I do not use "ga_autoActivityTracking" and I have several operations

here is my code

build.gradle

compile 'com.google.android.gms:play-services-analytics:7.5.0' 

Application class

 Tracker mTracker = GoogleAnalytics.getInstance(context).newTracker(R.xml.tracker); 

tracker.xml

 <resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="TypographyDashes"> <!-- Replace placeholder GA tracking Id with a real one. --> <string name="ga_trackingId">UA-1111111-1</string> <bool name="ga_reportUncaughtExceptions">true</bool> <integer name="ga_sessionTimeout">300</integer> <!-- 1800 seconds is 30 minutes, which is the default. Included explicitly for ease of tweaking. --> <integer name="ga_dispatchInterval">1800</integer> <bool name="ga_debug">false</bool> </resources> 

I send screen views in onStart or onPageSelected in viewpager

 public static void sendScreenView(String screenName) { if (canSend()) { mTracker.setScreenName(screenName); mTracker.send(new HitBuilders.AppViewBuilder() .setCustomDimension(COUNTRY_INDEX, getCountryCode()).build()); Timber.i(TAG, "Screen View recorded: " + screenName); } else { Timber.i(TAG, "Screen View NOT recorded (analytics disabled or not ready)."); } } 
+8
android google-analytics google-analytics-v4
source share
4 answers

What is your bounce rate? If this is ~ 100%, there may be no problem with your code, but instead with the UX / UI of your application.

-one
source share

If you haven’t already done so, try setting automatic activity tracking to true.

 tracker.enableAutoActivityTracking(true); 

Usually you do this in a class extending the application.

-one
source share

try this tutorial where you can track actions or fragments manually

full source code and step-by-step instructions: click hare

-one
source share

Refer to the link below, its for Eclipse , but I think it can help you solve your problem.

How to integrate Google Analytics into an Android app

-one
source share

All Articles