我正在尝试使用 Google Analytics V4。我从https://developers.google.com/analytics/devguides/collection/android/v4/#next-steps获得了以下代码
他们正在讨论 APP_TRACKER、GLOBAL_TRACKER 和 ECOMMERCE_TRACKER。这些是什么,这有什么意义。
synchronized Tracker getTracker(TrackerName trackerId) {
if (!mTrackers.containsKey(trackerId)) {
GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(PROPERTY_ID)
: (trackerId == TrackerName.GLOBAL_TRACKER) ? analytics.newTracker(R.xml.global_tracker)
: analytics.newTracker(R.xml.ecommerce_tracker);
mTrackers.put(trackerId, t);
}
return mTrackers.get(trackerId);
}