Order tag

The WebSphere Commerce order tag collects information about a customer's order. The order tag creates two data sets: one for the shopping cart contents at the time of the order and the other for the order summary information.

For each item in the shopping cart, this tag collects the following data to pass to an external analytics system:
  • Product part number
  • Product name
  • Quantity
  • Base price
  • Customer identifier
  • Order identifier
  • Subtotal
  • Product category in the catalog the customer is currently browsing
  • Product category in the master catalog
  • Currency
  • Account name (when the transaction is a B2B direct transaction)
  • Contract name (when the transaction is a B2B direct transaction)
  • Store identifier
For the order summary information, this tag collects the following data to pass to an external analytics system:
  • Order identifier
  • Order subtotal
  • Shipping charges that are associated with the order
  • Customer identifier
  • Customer city
  • Customer state
  • Customer ZIP code
  • Currency
  • Promotion names that are applied to the order, which is separated by the delimiter '|'
  • Promotion adjustment values, which are separated by the delimiter '|'
  • Promotion codes, which are separated by the delimiter '|'
  • Store identifier
This tag can also pass extra parameters for tag customization.

Parameters

The following is a list of required and optional parameters for the order tag.

Note for IBM Digital Analytics: The following parameters are for the WebSphere Commerce <cm:order /> tag. This tag generates the IBM Digital Analytics cmCreateShopAction9Tag data tag and cmCreateOrderTag data tag.

To pass the shopping cart and order summary information that is listed at the beginning of this topic to an external analytics system, use one of the following parameters:
databean
Use this parameter if your order confirmation page JSP file already contains an order data bean. This parameter is a populated instance of the com.ibm.commerce.order.beans.OrderDataBean.

Using the databean parameter provides better performance than the orderId parameter because the order tag does not have to use other resources to generate the data bean from the orderId.

orderType
Use this parameter if your order confirmation page uses web services for order runtime functions. This parameter is a populated instance of the com.ibm.commerce.order.facade.datatypes.OrderType object.

Using the orderType parameter provides better performance than the orderId parameter because the order tag does not have to use other resources to generate the orderType data from the orderId.

orderId
If neither of the previous two parameters applies, use the orderId parameter. This parameter is the order ID of the order that is being displayed. The order tag automatically creates an order data bean to get the information that the external analytics system requires. This parameter is ignored if you have used the databean parameter or the orderType parameter.
useKitItems
This is an optional parameter. Set this parameter to true to process items in kits as separate order items.

To send tax-related data to the external analytics system, use the following additional parameters:

includeTaxInUnitPrice
An optional parameter that is used to conditionally exclude or include the tax along with the unit price sent to the external analytics system. The default value is false. If set to true, the unit price sent to the external analytics system is the sum of the unit price and the tax that is calculated for the particular product.
includeTaxInTotalPrice
An optional parameter that is used to conditionally exclude or include the tax along with the total price sent to the external analytics system. The default value is false. If set to true, the total price sent to the external analytics system is the sum of the order total and the tax that is calculated for the order totals. For IBM Digital Analytics: if this value is set to true, the shipping charges passed to IBM Digital Analytics in the cmCreateOrderTag data tag also include the shipping tax. If this value is set to false, the shipping charges passed to IBM Digital Analytics do not include the shipping tax.

You can use any of the following three parameters to send more information to the external analytics system:

extraparms
An optional parameter that you can use to send additional information that applies to all catalog entries in the order to the external analytics system. This parameter is provided for cases in which you might have negotiated `with the external analytics vendor to generate some custom report that requires additional information.

Note for IBM Digital Analytics: Use the extraparms parameter to pass either IBM Digital Analytics Explore attributes, or data for custom IBM Digital Analytics reports, or both. See Passing extra data to IBM Digital Analytics with the extraparms parameter.

There are multiple ways to pass values using the extraparms parameter:
Description Example
Specify explicit values as properly escaped JavaScript. To pass more than one value, separate values with a comma. extraparms="\"value1\", \"value2\""
Specify explicit values without escaping the values. To pass more than one value, separate values with a comma. extraparms="value1, value2"
Specify dynamic content by calling a method name. Any parameter using extraparms starting and ending with the $ symbol, for example, $getMethod$, is assumed to be a method name of the object that is passed using either of the parameters databean or orderType. The only restriction on the method name is that it must take no arguments and the object that is returned must implement the toString() method. extraparms="$getMethod$"
extraparmsMap
An optional parameter that you can use to send additional information that applies to specific catalog entries in the order to the external analytics system. This parameter is an alternative to the extraparms parameter when you want to attach different extra parameter values to each order item in the shopping cart instead of attaching the same extra parameter value to every item in the shopping cart.

Note for IBM Digital Analytics: Use the extraparmsMap parameter to pass either IBM Digital Analytics Explore attributes, or data for custom IBM Digital Analytics reports, or both. See Comparison of extra parameters for IBM Digital Analytics tags.

The input to this parameter is a java.util.Map type object in which the key for each entry in the map is the orderItemId The value for a particular key is the extra parameter that is passed along with the catalog entry associated with the order item. The value for each orderItemId is appended to the argument list for the analytics tag output of that particular order item.

The following is sample code to create a java.util.HashMap object to pass as the value for the extraparmsMap parameter:

<wcf:getData type="com.ibm.commerce.order.facade.datatypes.OrderType" 
var="orderForAn" expressionBuilder="findByOrderId" scope="request">
<wcf:param name="accessProfile" value="IBM_Details" />
<wcf:param name="orderId" value="${WCParam.orderId}" />
</wcf:getData>

<%
java.util.HashMap map = new java.util.HashMap();
com.ibm.commerce.order.facade.datatypes.OrderType 
ord = (com.ibm.commerce.order.facade.datatypes.OrderType) 
pageContext.getAttribute

("orderForAn",PageContext.REQUEST_SCOPE);
java.util.List orderItemList = ord.getOrderItem();
java.util.Iterator itr = orderItemList.iterator();
int i = 1;
while (itr.hasNext()) {
com.ibm.commerce.order.facade.datatypes.OrderItemType 
orderItemObj = (com.ibm.commerce.order.facade.datatypes.OrderItemType) itr.next();
String id = orderItemObj.getOrderItemIdentifier().getUniqueID();
map.put(id, "value" + i+ ".0-_-value" + i+ ".1");
i++;
}
pageContext.setAttribute("eMap",map);
%> 
orderExtraparms
An optional parameter that you can use to send additional information that applies to the order summary to the external analytics system.

Note for IBM Digital Analytics: Use the orderExtraparms parameter to pass either IBM Digital Analytics Explore attributes, or data for custom IBM Digital Analytics reports, or both. See Passing extra data to IBM Digital Analytics with the extraparms parameter.

There are multiple ways to pass values using the orderExtraparms parameter:
Description Example
Specify explicit values as properly escaped JavaScript. To pass more than one value, separate values with a comma. orderExtraparms="\"value1\", \"value2\""
Specify explicit values without escaping the values. To pass more than one value, separate values with a comma. orderExtraparms="value1, value2"
Specify dynamic content by calling a method name. Any parameter using extraparms starting and ending with the $ symbol, for example, $getMethod$, is assumed to be a method name of the object that is passed using either of the parameters databean or orderType. The only restriction on the method name is that it must take no arguments and the object that is returned must implement the toString() method. orderExtraparms="$getMethod$"

Tag versions

WebSphere Commerce provides two versions of the order tag:

  1. An abstract base tag implementation class: com.ibm.commerce.bi.taglib.OrderBaseTag. Analytics vendors who want to provide an order tag in their web analytics JSP tag library can extend this base tag class to get the order tag data and implement their own logic to generate the vendor-specific order tagging APIs.
  2. A default implementation of the order tag (<cm:order />) for IBM Digital Analytics. This implementation automatically generates the IBM Digital Analytics cmCreateShopAction9Tag data tag and cmCreateOrderTag data tag.