我有一个相当复杂的项目,有许多类型的我正在尝试跟踪(片段,活动,列表片段,地图活动)等等。我试图避免使用简单的跟踪器,因为我不能简单是一个类的子类。
我已经在我的各种活动中禁用了所有跟踪代码,试图查明这一点,只留下我的主Application子类中的代码。我已删除该应用并重新安装,希望能够清除Google Analytics数据库文件中的所有内容。
以下是我唯一与Google Analytics相关的代码:
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
//Track app launch with version info
PackageInfo pInfo = null;
try {
pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
} catch (NameNotFoundException e) {
e.printStackTrace();
}
String pageValue = "/app_launch/" + pInfo.versionName;
tracker = GoogleAnalyticsTracker.getInstance();
tracker.setDebug(true);
tracker.startNewSession(getString(R.string.ga_web_property_id), this);
tracker.trackPageView(pageValue);
tracker.dispatch();
/etc...
}
}
当我放置一个断点并观察catlog时,这就是我调用dispatch()时得到的结果。
我完全很困惑,为什么这会产生6个跟踪几乎相同的GET请求。我已经编辑了我的Google Analytics UA ID,但是这表示在应用启动时运行上述onCreate的输出。
02-06 15:48:54.831: I/GoogleAnalyticsTracker(351): User-Agent: GoogleAnalytics/1.4.2 (Linux; U; Android 2.2; en-us; google_sdk Build/FRF91)
02-06 15:48:54.831: I/GoogleAnalyticsTracker(351): GET /__utm.gif?utmwv=4.8.1ma&utmn=764228238&utmcs=UTF-8&utmsr=480x800&utmul=en-US&utmp=%2Fapp_launch%2F1.0&utmac=UA-99999999-9&utmcc=__utma%3D1.35850864.1328029689.1328545392.1328571456.14%3B&utmhid=-719954799&utmht=1328571456916&utmqt=677896 HTTP/1.1
02-06 15:48:54.970: I/GoogleAnalyticsTracker(351): Host: www.google-analytics.com
02-06 15:48:54.970: I/GoogleAnalyticsTracker(351): User-Agent: GoogleAnalytics/1.4.2 (Linux; U; Android 2.2; en-us; google_sdk Build/FRF91)
02-06 15:48:54.970: I/GoogleAnalyticsTracker(351): GET /__utm.gif?utmwv=4.8.1ma&utmn=258792797&utmcs=UTF-8&utmsr=480x800&utmul=en-US&utmp=%2Fapp_launch%2F1.0&utmac=UA-99999999-9&utmcc=__utma%3D1.35850864.1328029689.1328571456.1328572132.15%3B&utmhid=968419361&utmht=1328572132799&utmqt=2154 HTTP/1.1
02-06 15:48:55.021: I/GoogleAnalyticsTracker(351): Host: www.google-analytics.com
02-06 15:48:55.021: I/GoogleAnalyticsTracker(351): User-Agent: GoogleAnalytics/1.4.2 (Linux; U; Android 2.2; en-us; google_sdk Build/FRF91)
02-06 15:48:55.021: I/GoogleAnalyticsTracker(351): GET /__utm.gif?utmwv=4.8.1ma&utmn=764228238&utmcs=UTF-8&utmsr=480x800&utmul=en-US&utmp=%2Fapp_launch%2F1.0&utmac=UA-99999999-9&utmcc=__utma%3D1.35850864.1328029689.1328545392.1328571456.14%3B&utmhid=-719954799&utmht=1328571456916&utmqt=678094 HTTP/1.1
02-06 15:48:55.100: I/GoogleAnalyticsTracker(351): Host: www.google-analytics.com
02-06 15:48:55.100: I/GoogleAnalyticsTracker(351): User-Agent: GoogleAnalytics/1.4.2 (Linux; U; Android 2.2; en-us; google_sdk Build/FRF91)
02-06 15:48:55.100: I/GoogleAnalyticsTracker(351): GET /__utm.gif?utmwv=4.8.1ma&utmn=764228238&utmcs=UTF-8&utmsr=480x800&utmul=en-US&utmp=%2Fapp_launch%2F1.0&utmac=UA-99999999-9&utmcc=__utma%3D1.35850864.1328029689.1328545392.1328571456.14%3B&utmhid=-719954799&utmht=1328571456916&utmqt=678175 HTTP/1.1
02-06 15:48:55.171: I/GoogleAnalyticsTracker(351): Host: www.google-analytics.com
02-06 15:48:55.171: I/GoogleAnalyticsTracker(351): User-Agent: GoogleAnalytics/1.4.2 (Linux; U; Android 2.2; en-us; google_sdk Build/FRF91)
02-06 15:48:55.171: I/GoogleAnalyticsTracker(351): GET /__utm.gif?utmwv=4.8.1ma&utmn=764228238&utmcs=UTF-8&utmsr=480x800&utmul=en-US&utmp=%2Fapp_launch%2F1.0&utmac=UA-99999999-9&utmcc=__utma%3D1.35850864.1328029689.1328545392.1328571456.14%3B&utmhid=-719954799&utmht=1328571456916&utmqt=678251 HTTP/1.1
02-06 15:48:55.251: I/GoogleAnalyticsTracker(351): Host: www.google-analytics.com
02-06 15:48:55.251: I/GoogleAnalyticsTracker(351): User-Agent: GoogleAnalytics/1.4.2 (Linux; U; Android 2.2; en-us; google_sdk Build/FRF91)
02-06 15:48:55.251: I/GoogleAnalyticsTracker(351): GET /__utm.gif?utmwv=4.8.1ma&utmn=764228238&utmcs=UTF-8&utmsr=480x800&utmul=en-US&utmp=%2Fapp_launch%2F1.0&utmac=UA-99999999-9&utmcc=__utma%3D1.35850864.1328029689.1328545392.1328571456.14%3B&utmhid=-719954799&utmht=1328571456916&utmqt=678324 HTTP/1.1