private Map<String, String> parsePayload(Map<String, Object> analyticsPayload) { HitBuilders.EventBuilder eventBuilder = new HitBuilders.EventBuilder(); //TODO Should this be protected, or crash in purpose to avoid mistakes on dev side? if (analyticsPayload.containsKey(CATEGORY)) { eventBuilder.setCategory((String) analyticsPayload.get(CATEGORY)); } if (analyticsPayload.containsKey(ACTION)) { eventBuilder.setCategory((String) analyticsPayload.get(ACTION)); } if (analyticsPayload.containsKey(LABEL)) { eventBuilder.setLabel((String) analyticsPayload.get(LABEL)); } if (analyticsPayload.containsKey(VALUE)) { eventBuilder.setValue((Long) analyticsPayload.get(VALUE)); } if (analyticsPayload.containsKey(PRODUCT)) { eventBuilder.addProduct((Product) analyticsPayload.get(PRODUCT)); } if (analyticsPayload.containsKey(PRODUCT_ACTION)) { eventBuilder.setProductAction((ProductAction) analyticsPayload.get(PRODUCT_ACTION)); } return eventBuilder.build(); }
/** * @see com.google.android.gms.analytics.HitBuilders.HitBuilder#setProductAction(ProductAction) */ @Override public HitInterceptor.ScreenViewFacade setProductAction(ProductAction action) { builder.setProductAction(action); return this; }
/** * @see com.google.android.gms.analytics.HitBuilders.EventBuilder#setProductAction(ProductAction) */ @Override public HitInterceptor.EventFacade setProductAction(ProductAction action) { builder.setProductAction(action); return this; }
T setProductAction(ProductAction action);