本文整理汇总了Java中com.google.analytics.tracking.android.Tracker.send方法的典型用法代码示例。如果您正苦于以下问题:Java Tracker.send方法的具体用法?Java Tracker.send怎么用?Java Tracker.send使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.analytics.tracking.android.Tracker
的用法示例。
在下文中一共展示了Tracker.send方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: trackEvent
import com.google.analytics.tracking.android.Tracker; //导入方法依赖的package包/类
private void trackEvent(String category, String action, String label, long value, CallbackContext callbackContext) {
if (! trackerStarted ) {
callbackContext.error("Tracker not started");
return;
}
Tracker tracker = GoogleAnalytics.getInstance(this.cordova.getActivity()).getDefaultTracker();
addCustomDimensionsToTracker(tracker);
if (null != category && category.length() > 0) {
tracker.send(MapBuilder
.createEvent(category, action, label, value)
.build()
);
callbackContext.success("Track Event: " + category);
} else {
callbackContext.error("Expected non-empty string arguments.");
}
}
示例3: 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);
}
示例4: onCreate
import com.google.analytics.tracking.android.Tracker; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_menu);
Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
serviceIntent.setPackage("com.android.vending");
bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);
findViewById(R.id.pack1_button).setOnClickListener(this);
findViewById(R.id.pack2_button).setOnClickListener(this);
Tracker tracker = GoogleAnalytics.getInstance(this).getTracker("UA-51610813-3");
tracker.send(MapBuilder.createAppView().set(Fields.SCREEN_NAME, "Home Screen").build());
BugSenseHandler.initAndStartSession(MainMenu.this, "718d6664");
}
示例5: onActivityResult
import com.google.analytics.tracking.android.Tracker; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == 1001) {
if (resultCode == Activity.RESULT_OK) {
try {
Intent intent = new Intent(this, DrawerSliderActivity.class);
intent.putExtra("pack", "pack2");
startActivity(intent);
Tracker tracker = GoogleAnalytics.getInstance(this).getTracker("UA-51610813-3");
tracker.send(MapBuilder
.createEvent("Buy", "pack", "item_bouth", null)
.build());
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
示例6: sendEvent
import com.google.analytics.tracking.android.Tracker; //导入方法依赖的package包/类
public static void sendEvent(String eventName){
android.util.Log.d(YandexMetrikaApplication.class.getSimpleName(), "sendEvent "+eventName);
Tracker tracker = getTracker();
if(tracker!=null) {
tracker.send(MapBuilder.createEvent("mm_android", eventName, null, null).build());
}
}
示例7: 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());
}
示例8: finish_anim
import com.google.analytics.tracking.android.Tracker; //导入方法依赖的package包/类
public void finish_anim() {
Animation animFadein = AnimationUtils.loadAnimation(
getApplicationContext(), R.anim.slide_finish);
level_finished.setVisibility(View.VISIBLE);
animFadein.setAnimationListener(finish_anim);
level_finished.startAnimation(animFadein);
int count = screenH / 100;
for (int i = 0; i < count; i++) {
int id_image = 0;
if (i % 2 == 0)
id_image = R.drawable.star_pink;
else
id_image = R.drawable.star_white;
ParticleSystem ps = new ParticleSystem(this, 100, id_image, 800);
ps.setScaleRange(0.7f, 1.3f);
ps.setSpeedRange(0.2f, 0.5f);
ps.setRotationSpeedRange(90, 180);
ps.setFadeOut(200, new AccelerateInterpolator());
int xStart = (int) (screenW * Math.random());
int yStart = (int) (screenH * Math.random());
ps.oneShot(xStart, yStart, 70);
}
final Animation scale = AnimationUtils.loadAnimation(
getApplicationContext(), R.anim.scale_anim);
homeBtn.startAnimation(scale);
Tracker tracker = GoogleAnalytics.getInstance(this).getTracker("UA-51610813-3");
tracker.send(MapBuilder
.createEvent("Level", packName, "finish_drawing_" + level, null)
.build());
}
示例9: onClick
import com.google.analytics.tracking.android.Tracker; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.pack1_button:
Intent intent = new Intent(this, DrawerSliderActivity.class);
intent.putExtra("pack", "pack1");
startActivity(intent);
break;
case R.id.pack2_button:
Tracker tracker = GoogleAnalytics.getInstance(this).getTracker("UA-51610813-3");
tracker.send(MapBuilder
.createEvent("Buy", "pack", "try_to_buy", null)
.build());
if (deviceHasGoogleAccount())
buyClick(v);
else {
tracker.send(MapBuilder
.createEvent("Buy", "pack", "no_account", null)
.build());
}
break;
}
}
示例10: pushSettingChengedEvent
import com.google.analytics.tracking.android.Tracker; //导入方法依赖的package包/类
/**
* 設定変更をpushする.
*
* @param context {@link Context}
* @param key キー
* @param newValue 値
*/
public static void pushSettingChengedEvent(Context context, String key, Object newValue) {
Tracker tracker = EasyTracker.getInstance(context);
if (newValue != null && newValue instanceof Set) {
pushSettingChengedEvent(tracker, key, (Set<?>) newValue);
} else {
String newValueStr = newValue == null ? "nullpo" : String.valueOf(newValue);
tracker.send(MapBuilder.createEvent("settingChenged", key, newValueStr, null).build());
}
}
示例11: pushPreferenceCategory
import com.google.analytics.tracking.android.Tracker; //导入方法依赖的package包/类
/**
* 設定カテゴリをpushする.
*
* @param context {@link Context}
* @param value 送信文字列
*/
public static void pushPreferenceCategory(Context context, String value) {
Tracker tracker = EasyTracker.getInstance(context);
MapBuilder builder = MapBuilder.createAppView().set(Fields.SCREEN_NAME, value);
tracker.send(builder.build());
}