# <productTracking:clickProductEvent> Tag

The <productTracking:clickProductEvent> tag is used to generate a behavior event when a user has clicked (through) a product impression (Web content related to a product). This tag returns a URL query string containing event parameters, which is then used when forming the complete URL that hyperlinks the content. At least one of sku, categoryId, or documentId is required.

## Syntax

<tagName attribute="value" />

## Attributes

applicationName

Optional (String) - The webApp or application name, if applicable. Can be used to separate data when multiple storefronts are hosted on the same server (or persisted to the same database).

categoryId

Optional (String or Category object) - Category of the product associated with the content displayed, if applicable.

documentId

Required (String) - Name of the item that is displayed, if applicable (that is, an image URL or banner ad ID).

documentType

Optional (String) - Type or category of the item that is displayed, if applicable.

sku

Optional (String or ProductItem) - Object ID of the product associated with the content item that is displayed, if applicable. The sku is not normally required unless neither categoryId nor documentId is specified.

userId

Optional (String) - Name of the user for which the content was retrieved. If the optional value is not provided, it will be set to the value of the request.getRemoteUser().

## Example

This example demonstrates a clickthrough example going to the Webflow servlet. This link will cause a clickthrough content event to be generated and also display the indicated content. This example shows how to generate a ClickProductEvent having a document ID using the product name (productItem.getName()) and SKU of the product’s identifier.

    <%
    detailsUrl = WebflowJSPHelper.createWebflowURL(pageContext, "itemsummary.jsp", "link(" + detailsLink + ")",
    "&" + HttpRequestConstants.CATALOG_ITEM_SKU + "=" + productItem.getKey().getIdentifier() + "&" +
    HttpRequestConstants.CATALOG_CATEGORY_ID + "=" + category.getKey().getIdentifier() + "&" +
    HttpRequestConstants.DOCUMENT_TYPE + "=" + detailsLink, true);
    %>
    <productTracking:clickProductEvent id="url" documentId="<%= productItem.getName() %>"
    sku="<%= productItem.getKey().getIdentifier() %>" />
    <%
    detailsUrl = detailsUrl + "&" + url;
    %>
    <a href="<%= detailsUrl %>">

Related Topics

<productTracking:displayProductEvent> Tag

<BehaviorTracking:clickContentEvent> Tag

<BehaviorTracking:displayContentEvent> Tag