本文整理汇总了Java中com.google.analytics.tracking.android.Tracker.set方法的典型用法代码示例。如果您正苦于以下问题:Java Tracker.set方法的具体用法?Java Tracker.set怎么用?Java Tracker.set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.analytics.tracking.android.Tracker
的用法示例。
在下文中一共展示了Tracker.set方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: trackView
import com.google.analytics.tracking.android.Tracker; //导入方法依赖的package包/类
private void trackView(String screenname, CallbackContext callbackContext) {
if (! trackerStarted ) {
callbackContext.error("Tracker not started");
return;
}
Tracker tracker = GoogleAnalytics.getInstance(this.cordova.getActivity()).getDefaultTracker();
addCustomDimensionsToTracker(tracker);
if (null != screenname && screenname.length() > 0) {
tracker.set(Fields.SCREEN_NAME, screenname);
tracker.send(MapBuilder
.createAppView()
.build()
);
callbackContext.success("Track Screen: " + screenname);
} else {
callbackContext.error("Expected one non-empty string argument.");
}
}
示例2: onStart
import com.google.analytics.tracking.android.Tracker; //导入方法依赖的package包/类
@Override
public void onStart() {
super.onStart();
final Tracker tracker = EasyTracker.getInstance(getActivity());
tracker.set(Fields.SCREEN_NAME, "Recipes list");
tracker.send(MapBuilder.createAppView().build());
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(RecipesManager.ACTION_FINISH_LOADING_RECIPES);
intentFilter.addAction(RecipesManager.ACTION_START_LOADING_RECIPES);
if (RecipesApplication.isLoadingRecipes) {
getActivity().setProgressBarIndeterminateVisibility(true);
} else {
getActivity().setProgressBarIndeterminateVisibility(false);
}
LocalBroadcastManager.getInstance(getActivity()).registerReceiver(broadcastReceiver,
intentFilter);
}
示例3: addCustomDimensionsToTracker
import com.google.analytics.tracking.android.Tracker; //导入方法依赖的package包/类
private void addCustomDimensionsToTracker(Tracker tracker) {
for (Entry<String, String> entry : customDimensions.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
//System.out.println("Setting tracker dimension slot " + key + ": <" + value+">");
tracker.set(Fields.customDimension(Integer.parseInt(key)), value);
}
}
示例4: onStart
import com.google.analytics.tracking.android.Tracker; //导入方法依赖的package包/类
@Override
public void onStart() {
super.onStart();
final Tracker tracker = EasyTracker.getInstance(getActivity());
tracker.set(Fields.SCREEN_NAME, "Recipe Details");
tracker.send(MapBuilder.createAppView().build());
}
示例5: trackAnalytics
import com.google.analytics.tracking.android.Tracker; //导入方法依赖的package包/类
private void trackAnalytics() {
EasyTracker.getInstance().setContext(this);
Tracker tracker = EasyTracker.getInstance().getTracker();
if (mPhotoUser != null) {
tracker.set("&uid", mPhotoUser.id.toString());
} else {
tracker.set("&uid", null);
}
if (mPhoto != null) {
tracker.trackView("image/" + mPhoto.id);
}
}
示例6: trackAnalytics
import com.google.analytics.tracking.android.Tracker; //导入方法依赖的package包/类
private void trackAnalytics() {
EasyTracker.getInstance().setContext(this);
Tracker tracker = EasyTracker.getInstance().getTracker();
if (mPhotoUser != null) {
tracker.set("&uid", mPhotoUser.id.toString());
} else {
tracker.set("&uid", null);
}
if (mTheme != null) {
tracker.trackView("theme/" + mTheme.id.toString());
}
}