Product events

added in 1.2.2

Product events are a special type of event. They have predefined event types and can be used to capture user’s shopping activity.

Define and send your product event

Every event type is predefined by enum type ProductEventType. It suggests one of 16 types of product events Below, you can find an example of sending product events to app.

Sending that event to is as simple as:

  • // MY_PRODUCT_ID and defined ProductEventType are required
    UserCom.getInstance().sendProductEvent("MY_PRODUCT_ID", ProductEventType.ADD_TO_CART, myParams);

    Where myParams is an optional key-value map containing the custom parameters you would like to send and it can look like this:

  • HashMap<String, Object> myParams = new HashMap();
        // Add attributes and values
        myParams.put("attr1", "value1");
        myParams.put("attr2", "value2");

Note that events are sent right away. If you do not have an internet connection they will be queued and sent whenever an internet connection is available.