Reference > Analytics for IBM WebSphere Commerce > Analytics tag library for IBM WebSphere Commerce


Order tag

Overview

The order tag collects information about a customer's order and sends the information to an external analytics system. The order tag creates two data sets:

The data generated by this tag for each item in the shopping cart includes:

The data captured by this tag for the order details includes:

WebSphere Commerce provides an abstract base tag implementation class for the order tag: OrderBaseTag

This base tag collects information about an analytics order completion event. 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.


Order tag parameters

databean Optional. Populated instance of the OrderDataBean.

If this parameter is missing, one will be created if the orderid attribute is not empty.

orderId Optional. Order ID of the order being displayed.

Ignored if a value is specified using the databean parameter or the orderType parameter.

includeTaxInUnitPrice Optional. 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 calculated for the particular product.

includeTaxInTotalPrice Optional. 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 unit price and the tax calculated for the order totals.

extraparms Optional. Communicate additional information to the external analytics system as necessary.

Provided for cases in which you might have negotiated with the external analytics vendor to generate some custom report that requires additional information. Information specified is appended to the argument list in the analytics tag output and should be properly escaped JavaScript.

To pass more than one parameter, separate values with a comma...

extraparms="\"field1\", \"field2\""

Allows you to make a function call within the given data bean, which supports dynamic content. Any parameter using extraparms starting and ending with the $ symbol, for example, $getMethod$, will be assumed to be a method name of the object passed using either of the attributes databean or orderType. The only restriction on the method name is that it must take no arguments and the object returned must implement the toString() method.

extraparmsMap Optional. Communicate additional information to the external analytics system as necessary.

Useful when additional information needs to be passed with each catalog entry in the shopping cart. This is different from the parameter extraparms because the values passed as extraparms are appended to all catalog entries present in the shopping cart.

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 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.

To pass more than one parameter, separate the values with a comma...

extraparmsMap="\"field1\", \"field2\""

orderExtraparms Optional. Communicates additional information to the external analytics system as necessary.

Information specified is appended to the argument list in the analytics tag output and should be properly escaped JavaScript.

To pass more than one parameter, separate values with a comma...

orderExtraparms="\"field1\", \"field2\""

Allows you to make a function call within the given data bean to support dynamic content. Any parameter given in orderExtraparms starting and ending with the $ symbol, for example, $getMethod$, will be assumed to be a method name of the object passed using either of the attributes databean or orderType. The only restriction on the method name is that it must take no arguments and the object returned must implement the toString() method.

orderType: Optional. Populated instance of...

com.ibm.commerce.order.facade.datatypes.OrderType


Order tag for Coremetrics

WCS provides a default implementation of the order tag for Coremetrics. This tag must be included in the order confirmation page.

To use this tag, include the tag library in the JSP page. The order tag must be included in the JSP before the page view tag.

The tag library must be referenced prior to the main page content...

<%@ taglib uri="http://commerce.ibm.com/coremetrics" prefix="cm" %>


Examples:

In most cases, to add the order tag, you only need to include the following code:

    <cm:order databean="${order_OrderDataBean}" />

or

    <cm:order orderType="${order}" /> 

To include the tax in the unit price and order total sent to Coremetrics...

    <cm:order orderType="${order}" 
              includeTaxInUnitPrice="true" 
              includeTaxInTotalPrice="true" />


XML definition:

<tag>  

<name>order</name>  

<tag-class>com.ibm.commerce.bi.taglib.coremetrics.OrderTag</tag-class>  
    
    <body-content>empty</body-content>  
    
    <description>
        Set ShopAction9 and Order tags for order confirmation pages.
    </description>  
    
    <attribute>    
        <name>databean</name>    
        <required>false</required>    
        <rtexprvalue>true</rtexprvalue>    
    
        <description>
            Populated instance of com.ibm.commerce.order.beans.OrderDataBean.  
            If missing, one will be created if orderid attribute is not empty.
        </description>  
    
    </attribute>  
    
    <attribute>    
        <name>orderId</name>    
        <required>false</required>    
        <rtexprvalue>true</rtexprvalue>    
        <description>
            Order ID of the order being displayed. 
            Will be ignored if a databean is given.
        </description>  
    </attribute>  

    <attribute>    
        <name>orderType</name>    
        <required>false</required>    
        <rtexprvalue>true</rtexprvalue>    
        <description>
            The OrderType object used to get the tag details
        </description>  
    </attribute>  
    <attribute>    
        <name>extraparms</name>    
        <required>false</required>    
        <rtexprvalue>true</rtexprvalue>    
        <description>
            Additional fields that will be appended to argument list in the Coremetrics ShopAction9 tag output. 
            To pass more than 1 parameter, use an input like extraparms="\"field1\", \"field2\"".
        </description>  
        </attribute>  
    <attribute>    
        <name>extraparmsMap</name>    
        <required>false</required>    
        <rtexprvalue>true</rtexprvalue>    
        <description>
            Additional fields that will be appended to the
            argument list for the items in the shopping cart in the Coremetrics
            tag output depending on the map's value for that particular item in the cart
        </description>  
    </attribute>    
     
    <attribute>    
        <name>orderExtraparms</name>    
        <required>false</required>    
        <rtexprvalue>true</rtexprvalue>    
        <description>
            Additional fields that will be appended to argument list in the Coremetrics order tag output. 
            To pass more than 1 parameter, use an input like extraparms="\"field1\", \"field2\"".
        </description>  
        </attribute>            
     
    <attribute>    
        <name>includeTaxInUnitPrice</name>    
        <required>false</required>    
        <rtexprvalue>true</rtexprvalue>    
        <description>
            Include/Exclude Tax in Unit price
        </description>  
    </attribute>  
    <attribute>    
        <name>includeTaxInTotalPrice</name>    
        <required>false</required>    
        <rtexprvalue>true</rtexprvalue>    
        <description>
            Include/Exclude Tax in total price
        </description>  
    </attribute>
</tag> 


Related tasks

Tag the store pages for Coremetrics

Related reference

Page view tag
Shop cart tag
Product tag
Registration tag
Campaign URL tag
Content URL tag
Generic tag


+

Search Tips   |   Advanced Search