In order to generate reports that associate search terms with items that are viewed or purchased, your sites must record “click-through” events. These occur when a customer clicks on a product or SKU returned by a search, to view it or purchase it. The recording of these events works like this:
For each result returned by Guided Search, the
GetSearchClickThroughId
servlet bean generates a click-through ID, which you can append to the URL for that result using a query parameter namedsearchClickId
. The servlet bean also adds the record to a cache.When a customer clicks a link to view a search result, the
SearchClickThroughServlet
examines the request URL, finds the value of thesearchClickId
query parameter, and uses it to look up the record in the cache. If it finds the record, the servlet fires a JMS event containing data from the search request and response. This event is logged to be used for reporting.
This section discusses how click-through events are used to associate search results with views of specific products. The Recording Search Results Placed in Shopping Carts section discusses how click-through events are used to associate search results with sales of specific products.