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"> <string name="ga_trackingId">UA-1111111-1</string> <bool name="ga_reportUncaughtExceptions">true</bool> <integer name="ga_sessionTimeout">300</integer> <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)."); } }
android google-analytics google-analytics-v4
Mar abdan
source share