To associate click-through events with items placed in shopping carts, the /atg/reporting/datacollection/commerce/ItemAddedToOrderListener
message sink responds to JMS messages of type atg.commerce.order.ItemAddedToOrder
. ItemAddedToOrderListener
passes the message to the /atg/reporting/datacollection/commerce/CommerceItemMarkerHandler
component, which adds a marker to the commerce item. The marker key is atg.endeca
, and the marker value is the search ID.
When submitted orders are loaded into the data warehouse, the OrderSubmitLoader
uses the atg.endeca
markers to track which purchased items are associated with searches. This information is used to generate search conversion reports.
See the Core Commerce Programming Guide for more information about the OrderSubmitLoader
.
Configuring CommerceItemMarkerHandler
In order to add a marker to a commerce item placed in a shopping cart, the CommerceItemMarkerHandler
component is configured to track the type of repository item it is (typically product
, sku
, or a subtype of product
or sku
). To enable this tracking, CommerceItemMarkerHandler
has a recordItemDescriptorPropertyName
property that is set to the name of a record property that holds the name of the item type.
The recordItemDescriptorPropertyName
property is set by default to record.type.raw
. This is a special property created by the /atg/endeca/index/accessor/ItemDescriptorNameAccessor
component. By default, the ProductCatalogOutputConfig
component’s XML definition file is configured to use this property accessor to include the record.type.raw
property in the indexed records:
<property name="recordtyperaw" is-dimension="false" type="string"
property-accessor="/atg/endeca/index/accessor/ItemDescriptorNameAccessor"
output-name="record.type.raw" is-non-repository-property="true"
text-searchable="false"/>
The value of the record.type.raw
record property is the name of an item type for the record. Typically it has multiple values. For example:
<PROP NAME="record.type.raw">
<PVAL>product</PVAL>
</PROP>
<PROP NAME="record.type.raw">
<PVAL>sku</PVAL>
</PROP>
When an item is added to the cart, the record is checked to see if any of the values of record.type.raw
match the item type. If so, a marker is added to the item. In the example above, if the item type is product
or sku
, a marker is added to the item.
The CommerceItemMarkerHandler
component’s recordItemRepositoryIdProperty
property should be set to the name of the record property that holds the repository ID of the document-level item for the record. By default, recordItemRepositoryIdProperty
is set to product.repositoryId
.
As with the record property used for storing and retrieving items in the record cache, the record properties specified by recordItemDescriptorPropertyName
and recordItemRepositoryIdProperty
must be listed in the fieldNames
property of the ResultsListConfig
component to ensure they are included in the ContentItem
returned by the Assembler. If you change the value of recordItemDescriptorPropertyName
or recordItemRepositoryIdProperty
, be sure to modify fieldNames
accordingly.