private void addTransactionItem( String id, String name, String sku, String category, double price, long quantity, String currencyCode, CallbackContext callbackContext) { if (!trackerStarted) { callbackContext.error("Tracker not started"); return; } if (null != id && id.length() > 0) { HitBuilders.ItemBuilder hitBuilder = new HitBuilders.ItemBuilder(); addCustomDimensionsToHitBuilder(hitBuilder); tracker.send( hitBuilder .setTransactionId(id) .setName(name) .setSku(sku) .setCategory(category) .setPrice(price) .setQuantity(quantity) .setCurrencyCode(currencyCode) .build()); // Deprecated callbackContext.success("Add Transaction Item: " + id); } else { callbackContext.error("Expected non-empty ID."); } }
@Override public ItemHitBuilder setCustomMetric(int index, float metric) { super.setCustomMetric(index, metric); return this; }
@Override public ItemHitBuilder setCustomDimension(int index, String dimension) { super.setCustomDimension(index, dimension); return this; }