sto usando Google Analytics su Android e mi dà un sacco di avg durata della sessione: 00:00:00Google Analytics su Android dà durata della sessione media: 00:00:00
si prega di notare che io non sto usando "ga_autoActivityTracking" e ho più di un'attività
ecco il mio codice
build.gradle
compile 'com.google.android.gms:play-services-analytics:7.5.0'
classe Application
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>
trasmetto di schermate sulla funzione onStart o Wi onPageSelected sottile un 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).");
}
}