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(); }
@NonNull public EventTracker addProduct(final Product product) { builder.addProduct(product); return this; }
/** * @see com.google.android.gms.analytics.HitBuilders.HitBuilder#addProduct(Product) */ @Override public HitInterceptor.ScreenViewFacade addProduct(Product product) { builder.addProduct(product); return this; }
/** * @see com.google.android.gms.analytics.HitBuilders.HitBuilder#addImpression(Product, String) */ @Override public HitInterceptor.ScreenViewFacade addImpression(Product product, String impressionList) { builder.addImpression(product, impressionList); return this; }
/** * @see com.google.android.gms.analytics.HitBuilders.EventBuilder#addProduct(Product) */ @Override public HitInterceptor.EventFacade addProduct(Product product) { builder.addProduct(product); return this; }
/** * @see com.google.android.gms.analytics.HitBuilders.EventBuilder#addImpression(Product, String) */ @Override public HitInterceptor.EventFacade addImpression(Product product, String impressionList) { builder.addImpression(product, impressionList); return this; }
T addProduct(Product product);
T addImpression(Product product, String impressionList);