public class ExperimentEvaluationECEventListenerImpl
extends com.ibm.commerce.event.impl.AbstractECEventListener
When customizing the experiment statistics, extend this class to correlate a customer's order to a customer's action in their session by doing the following:
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String | CLICKED
This field contains a constant that indicates that the test element was clicked by the user.
|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
protected static java.lang.String | RESULTTYPE_A
This field contains a constant for an awareness advertisement test element recommendation.
|
protected static java.lang.String | RESULTTYPE_C
This field contains a constant for a category test element recommendation.
|
protected static java.lang.String | RESULTTYPE_D
This field contains a constant for a discount or promotion test element recommendation.
|
protected static java.lang.String | RESULTTYPE_P
This field contains a constant for a product test element recommendation.
|
Constructor and Description |
---|
ExperimentEvaluationECEventListenerImpl()
This method creates an instance of the experiment evaluation event listener.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.StringBuffer | addCustomDataToLogQuery(java.lang.StringBuffer sb)
This method updates the EXPLOG table query with the custom data columns.
|
protected int | addCustomDataToStatisticsUpdate(java.sql.PreparedStatement ps, int index)
This method updates the EXPSTATS update statement with the data for the custom data columns.
|
protected java.lang.StringBuffer | addCustomDataToStatisticsUpdate(java.lang.StringBuffer sb)
This method updates the EXPSTATS update statement with the custom data columns.
|
protected void | dialogMarketingEvaluateOrder(java.util.List orders)
This method calls the marketing web service to evaluate an order and determine if it was influenced by the data displayed to the customer in an eMarketing Spot.
|
java.lang.Class | getECEventContainer()
This method returns the class OrderSubmissionEventContainer as the event container.
|
java.util.Set | getEvents()
This method returns a set containing the extension name for the order submission event.
|
protected java.lang.String | getOrderCurrency()
This method gets the currency of the current order being processed.
|
protected java.math.BigDecimal | getOrderTotal()
This method gets the total revenue amount of the current order being processed.
|
protected boolean | processAdResultType(java.util.List orders, java.lang.String results, java.lang.Integer storeId)
This method should be overridden to check whether or not the order can be correlated with the displayed awareness ad.
|
protected boolean | processCategoryResultType(java.util.List orders, java.lang.String results, java.lang.Integer storeId)
This method checks if the orderitems in the order were under recommended categories.
|
protected boolean | processDiscountResultType(java.util.List orders, java.lang.String results, java.lang.Integer storeId)
This method checks if the promotions associated with the order were recommended promotions.
|
void | processEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent commonBaseEvent)
This method processes order submission common base events.
|
protected void | processOrderSubmissionEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent cbe)
This method processes the order submission event.
|
protected boolean | processOtherResultType(java.sql.ResultSet rs, int index, java.lang.String resulttype, java.util.List orders, java.lang.Integer experimentId, java.lang.Integer testelementId, java.lang.String results, java.lang.String clicked, java.lang.Integer storeId, org.eclipse.hyades.logging.events.cbe.CommonBaseEvent cbe)
This method should be overridden to check whether or not the order can be correlated with the displayed test element.
|
protected boolean | processProductResultType(java.util.List orders, java.lang.String results, java.lang.Integer storeId)
This method checks if any of the orderitems in the order were recommended products.
|
protected void | setOrderCurrency(java.lang.String c)
This method sets the currency of the current order being processed.
|
protected void | setOrderTotal(java.math.BigDecimal o)
This method sets the total revenue amount of the current order being processed.
|
void | setTestData(java.lang.Long orderId, java.lang.String sessionId)
Reserved for IBM internal use.
|
protected void | updateStatisticsTable(java.lang.Integer experimentId, java.lang.Integer testelementId, java.lang.Integer storeId, java.lang.String clicked)
This method updates the statistics table with the information from the order by doing the following: Increments the number of orders associated with the test element, and updates the associated revenue. Updates the 'displays' data, and if the test element was clicked by the user, then it updates the 'clicks' data as well.
|
public static final java.lang.String COPYRIGHT
protected static final java.lang.String RESULTTYPE_P
protected static final java.lang.String RESULTTYPE_D
protected static final java.lang.String RESULTTYPE_C
protected static final java.lang.String RESULTTYPE_A
protected static final java.lang.String CLICKED
public ExperimentEvaluationECEventListenerImpl()
public void processEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent commonBaseEvent)
protected void processOrderSubmissionEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent cbe)
protected boolean processProductResultType(java.util.List orders, java.lang.String results, java.lang.Integer storeId) throws java.sql.SQLException
protected boolean processDiscountResultType(java.util.List orders, java.lang.String results, java.lang.Integer storeId) throws java.sql.SQLException
protected boolean processCategoryResultType(java.util.List orders, java.lang.String results, java.lang.Integer storeId) throws java.sql.SQLException
protected boolean processAdResultType(java.util.List orders, java.lang.String results, java.lang.Integer storeId) throws java.sql.SQLException
protected void updateStatisticsTable(java.lang.Integer experimentId, java.lang.Integer testelementId, java.lang.Integer storeId, java.lang.String clicked) throws java.sql.SQLException
protected void setOrderTotal(java.math.BigDecimal o)
protected void setOrderCurrency(java.lang.String c)
protected java.math.BigDecimal getOrderTotal()
protected java.lang.String getOrderCurrency()
public void setTestData(java.lang.Long orderId, java.lang.String sessionId)
public java.lang.Class getECEventContainer()
public java.util.Set getEvents()
protected java.lang.StringBuffer addCustomDataToLogQuery(java.lang.StringBuffer sb)
sb.append(", EXPLOG.GIFTCLICKED, EXPLOG.WISHCLICKED "); return sb;The necessary data will then be in the ResultSet passed to the processOtherResultType method.
protected boolean processOtherResultType(java.sql.ResultSet rs, int index, java.lang.String resulttype, java.util.List orders, java.lang.Integer experimentId, java.lang.Integer testelementId, java.lang.String results, java.lang.String clicked, java.lang.Integer storeId, org.eclipse.hyades.logging.events.cbe.CommonBaseEvent cbe) throws java.sql.SQLException
String giftclick = rs.getString(index++); String wishclick = rs.getString(index++);
If the contents of the order can then be correlated with the user's gift registy, then set a flag that the two addCustomDataToStatisticsUpdate methods should update the gift registry data in the statistics table.
The following is some sample pseudo code:
Iterator itr = orders.iterator(); while (itr.hasNext()) { OrderData orderData = (OrderData) itr.next(); Long orderId = orderData.getOrderId(); giftFlag = false; wishFlag = false; // attempt to correlate the order // do a query, and retrieve the order total and order currency if (orderCorrelated == true) { giftFlag = true; setOrderTotal(THE ORDER TOTAL); setOrderCurrency(THE ORDER CURRENCY); return true; } }Similarly, check if the order can be correlated with the user's wish list.
This method should return true if the order was sucessfully correlated, and that the statistics table should to be updated. If true is returned, then two methods need to be called: setOrderTotal with the total amount of the order, and setOrderCurrency with the currency of the order. It is suggested you retrieve the order data when constructing your query to correlate the order with the appropriate business data.
(ORDERS.TOTALPRODUCT+ORDERS.TOTALTAX+ORDERS.TOTALSHIPPING+ORDERS.TOTALTAXSHIPPING+ORDERS.TOTALADJUSTMENT TOTAL, ORDERS.CURRENCY )
protected java.lang.StringBuffer addCustomDataToStatisticsUpdate(java.lang.StringBuffer sb)
if (giftFlag) { sb.append(", GIFTORDERS = GIFTORDERS + 1, GIFTREVENUE = GIFTREVENUE + ? "); } if (wishFlag) { sb.append(", WISHORDERS = WISHORDERS + 1, WISHREVENUE = WISHREVENUE + ? "); } return sb;The necessary data for the parameters need to be set in the addCustomDataToStatisticsUpdate(PreparedStatement, index) method. This class should be extended, and this method overridden.
protected int addCustomDataToStatisticsUpdate(java.sql.PreparedStatement ps, int index) throws java.sql.SQLException
if (giftFlag) { ps.setBigDecimal(index++, getOrderTotal()); } if (wishFlag) { ps.setBigDecimal(index++, getOrderTotal()); } return ps;This class should be extended, and this method overridden.
protected void dialogMarketingEvaluateOrder(java.util.List orders)