当前位置: 首页>>代码示例>>Java>>正文


Java Tracker.send方法代码示例

本文整理汇总了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.");
       }
   }
 
开发者ID:psydrake,项目名称:pandacoinBalance,代码行数:21,代码来源:UniversalAnalyticsPlugin.java

示例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.");
       }
   }
 
开发者ID:psydrake,项目名称:pandacoinBalance,代码行数:21,代码来源:UniversalAnalyticsPlugin.java

示例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);
}
 
开发者ID:groupsky,项目名称:android-recipes-app,代码行数:19,代码来源:RecipeItemListFragment.java

示例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");
}
 
开发者ID:AlexZaiats,项目名称:Coloring-book,代码行数:18,代码来源:MainMenu.java

示例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();
            }
        }
    }
}
 
开发者ID:AlexZaiats,项目名称:Coloring-book,代码行数:21,代码来源:MainMenu.java

示例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());
    }
}
 
开发者ID:progress-engine,项目名称:metrika_android,代码行数:8,代码来源:YandexMetrikaApplication.java

示例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());
}
 
开发者ID:groupsky,项目名称:android-recipes-app,代码行数:8,代码来源:RecipeItemDetailFragment.java

示例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());

}
 
开发者ID:AlexZaiats,项目名称:Coloring-book,代码行数:40,代码来源:DrawerActivity.java

示例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;
    }
}
 
开发者ID:AlexZaiats,项目名称:Coloring-book,代码行数:28,代码来源:MainMenu.java

示例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());
    }
}
 
开发者ID:75py,项目名称:XUtilities,代码行数:17,代码来源:AnalyticsUtil.java

示例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());
}
 
开发者ID:75py,项目名称:XUtilities,代码行数:12,代码来源:AnalyticsUtil.java


注:本文中的com.google.analytics.tracking.android.Tracker.send方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。