我刚刚在我的应用中添加了对Google Analytics的支持,我无法让XML配置中的<screenName>
正常工作:
配置:
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<screenName name="com...ActivityMain">Main</screenName>
<screenName name="com...ActivitySettings">Settings</screenName>
</resources>
I Manifest,我有:
<meta-data android:name="com.google.android.gms.analytics.globalConfigResource" android:resource="@xml/analytics" />
在应用程序中我有:
synchronized public Tracker getDefaultTracker() {
if (mTracker == null) {
final GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
//analytics.setDryRun(BuildConfig.DEBUG);
analytics.enableAutoActivityReports(this);
// To enable debug logging use: adb shell setprop log.tag.GAv4 DEBUG
mTracker = analytics.newTracker(R.xml.global_tracker);
mTracker.enableAutoActivityTracking(true);
mTracker.enableExceptionReporting(true);
}
return mTracker;
}
当我启用VERBOSE
调试时,我看到了:
Loading global XML config values
但是,那么:
Hit delivery requested: ht=1442573034900, _s=78, _v=ma7.8.95, a=1607163793, aid=cz..., an=XXX, av=0.10.2+801d661, cd=com...ActivitySettings, cid=..., sc=start, sr=768x1184, t=screenview, tid=UA-XXX-2, ul=cs-cz, v=1
正如您所看到的,cd
包含整个包名。