As my application, the number of sessions was about 1000-2000 when I used Google Android for Android SDK v3. 
But when I upgrade from v3 to v4, the number of sessions increases to 4000-5000. 
This is global_tracker.xml:
<?xml version="1.0" encoding="utf-8"?>
<bool name="ga_autoActivityTracking">true</bool> <string name="ga_trackingId">xx-xxxx-xx</string>
And this is what I did in the Application.java file:
public class ABCApplication extends Application { ... private static Tracker t; ... public synchronized Tracker getTracker() { if (this.t == null) { GoogleAnalytics analytics = GoogleAnalytics.getInstance(this); this.t = analytics.newTracker(R.xml.global_tracker); } return t; }}
And this is the MainActivity.java file:
public class MainActivity { @Override public void onStart() { super.onStart(); Tracker t = ((ABCApplication) this.getApplication()).getTracker(); t.send(new HitBuilders.EventBuilder().setCategory("app").setAction("app_launch") .setLabel("start_google_analytics").build()); } ...}
What is the cause of this problem? And how can I solve it?
android session google-analytics
nnezhxw
source share