コード例 #1
0
ファイル: OrdersActivity.java プロジェクト: barzdyka/pr
  // ACTIVITY + INIT
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    actionBarType = ActionBarType.ACTIONBAR_WITH_OVERFLOW_AND_CART;

    // GAv4
    HitBuilders.AppViewBuilder hba = new HitBuilders.AppViewBuilder();
    hba.setCustomDimension(1, MyaccountData.sharedInstance().getMemberPK());
    // ((PrivaliaApplication)getApplicationContext()).trackView("/app/myaccount/orders", hba);
    GATrack.getInstance().trackView(this, "/app/myaccount/orders", hba);

    initUI();
  }
  private void trackView(String screenname, CallbackContext callbackContext) {
    if (!trackerStarted) {
      callbackContext.error("Tracker not started");
      return;
    }

    if (null != screenname && screenname.length() > 0) {
      tracker.setScreenName(screenname);

      HitBuilders.AppViewBuilder hitBuilder = new HitBuilders.AppViewBuilder();
      addCustomDimensionsToHitBuilder(hitBuilder);

      tracker.send(hitBuilder.build());
      callbackContext.success("Track Screen: " + screenname);
    } else {
      callbackContext.error("Expected one non-empty string argument.");
    }
  }