BEA Logo BEA WLCS Release 3.5

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

   WLCS Documentation   |   Events Guide   |   Previous Topic   |   Next Topic   |   Contents   |   Index

JSP Tag Library Reference for Events and Behavior Tracking

 

This tag library contains several tag extensions used in the BEA WebLogic Personalization Server. Tags in this library are specifically used in the Events and Behavior Tracking component of the server.

The Events and Behavior Tracking tags allow you specify user behavior that you are interested in monitoring as users navigate across your site pages. These tags cause events to be generated which may be subsequently analyzed by third-party analytical tools, or which may be processed immediately in support of a campaign scenario.

The Events and Behavior Tracking tags are divided into three general areas: content tracking, product tracking, and campaign tracking. Content and product tracking tags can be used in any personalization or commerce application. The campaign tag generates events that feed into active campaign scenarios.

Note: To use the campaign features, you must have the BEA Campaign Manager for WebLogic installed on your system.

This topic includes the following sections:

<tr:clickContentEvent>

<tr:displayContentEvent>

<trp:clickProductEvent>

<trp:displayProductEvent>

<trc:clickCampaignEvent>

Use the following code to import the content events tag library:
<%@ taglib uri="tracking.tld" prefix="tr" %>

Use the following code to import the product events tag library:
<%@ taglib uri="productTracking.tld" prefix="trp" %>

Use the following code to import the campaign events tag library:
<%@ taglib uri="campaignTracking.tld" prefix="trc" %>

Note: The <tr:> prefix means "track."
The <trp:> prefix means "track-product."
The <trc:> prefix means "track-campaign."

<tr:clickContentEvent>

The <tr:clickContentEvent> tag (Table 5-1) is used to generate a behavior event when a user has clicked (through) on an ad impression. This tag will return a URL query string containing event parameters. It is then used when forming the complete URL that hyperlinks the content.

Use the following code to import the content events tag library:
<%@ taglib uri="tracking.tld" prefix="tr" %>

Table 5-1 <tr:clickContentEvent>

Tag Attribute

Req'd

Type

Description

R/C

documentId

No

String

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

R

documentType

No

String

Type or category of the item that is displayed (if applicable).

R

id

No

String

Page variable which will hold the output of this tag.

C

redirectURL

Yes

String

Where the server should redirect the client to after the document is clicked on and after the server processes the clickthrough event.

R

userId

No

String

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

R


 

Example

The example below demonstrates a clickthrough example going to the flow manager servlet. This link will cause a clickthrough content event to be generated and also display the indicated content. If you wish to redirect the client to an external site after recording the clickthrough event, specify a redirectURL attribute and target the clickThroughServlet instead of the flow manager servlet.

<%@ taglib uri="tracking.tld" prefix="tr" %>
.
.
.
<%-- Note: example code is from the news_index.jsp servlet --%>

<es:forEachInArray id="nextRow" array="<%=headlines%>"
type="com.beasys.commerce.axiom.content.Content">

<es:notNull item="<%=nextRow%>">

<tr:clickContentEvent
id="url"
documentId="<%=nextRow.getIdentifier()%>"
documentType="<%=headingProp%>"
userId="<%=request.getRemoteUser()%>"
redirectURL="http://netscape.com" />

<a href="<%=response.encodeURL(createURL(request,
getHomePage(request), (url + "&contentselected=" +

java.net.URLEncoder.encode
(nextRow.getIdentifier()))))%>">
<cm:printProperty id="nextRow" name="title" encode="html" /></a>

<%--
clickthrough example going to clickthrough servlet. This link will cause a clickthrough content event to be generated and then redirect the client.
--%>

<LI>
<a href="<%=response.encodeURL(request.getContextPath()
+ getClickThruPage() + "?" + url)%>">
<cm:printProperty id="nextRow" name="title" encode="html" />
</a>

</es:notNull>
</es:forEachInArray>

<tr:displayContentEvent>

The <tr:displayContentEvent> tag (Table 5-2) is used to generate a behavior event when a user has received (viewed) an ad impression, (typically a gif image).

Use the following code to import the content events tag library:
<%@ taglib uri="tracking.tld" prefix="tr" %>

Table 5-2 <tr:displayContentEvent>

Tag Attribute

Req'd

Type

Description

R/C

documentId

No

String

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

R

documentType

No

String

Type or category of the item that is displayed (if applicable).

R


 

Example

The example below shows a code snippet of processing that would follow a <cm:select> call. For each document returned but not displayed in this example, the <tr:displayContentEvent> tag generates an event and passes the document's ID and type.

<%@ taglib uri="tracking.tld" prefix="tr" %>
.
.
.
<es:forEachInArray id="nextRow" array="<%=headlines%>"
type="com.beasys.commerce.axiom.content.Content">

<es:notNull item="<%=nextRow%>">

<tr:displayContentEvent
documentId="<%=nextRow.getIdentifier()%>"
documentType="<%=headingProp%>"/>

</es:notNull>

</es:forEachInArray>

<trp:clickProductEvent>

The <trp:clickProductEvent> tag (Table 5-3) is used to generate a behavior event when a user has clicked (through) on a product impression. This tag will return a URL query string containing event parameters. It is then used when forming the complete URL that hyperlinks the content.

At least one of sku, categoryId, or documentId is required.

Use the following code to import the product events tag library:
<%@ taglib uri="productTracking.tld" prefix="trp" %>

Table 5-3 <trp:clickProductEvent>

Tag Attribute

Req'd

Type

Description

R/C

applicationName

No

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

R

categoryId

No

String or Category object

Category of the product associated with the content displayed, if applicable.

R

documentId

Yes

String

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

R

documentType

No

String

Type or category of the item that is displayed (if applicable).

R

redirectURL

No

String

Where the server should redirect the client to after the document is clicked on and after the server processes the clickthrough event.

R

sku

No

String or ProductItem object

ID of the product associated with the content item that is displayed, if applicable.

R

userId

No

String

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

R


 

Example

The example below demonstrates a clickthrough example going to the flow manager servlet. This link will cause a clickthrough product event to be generated and also display the indicated content. If you wish to redirect the client to an external site after recording the clickthrough event, specify a redirectURL attribute and target the clickThroughServlet instead of the flow manager servlet.

<%@ taglib uri="productTracking.tld" prefix="trp" %>
.
.
.
<%
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);
%>

<trp:clickProductEvent
id="url"
documentId="<%= productItem.getName() %>"
sku="<%= productItem.getKey().getIdentifier() %>" />

<%
detailsUrl = detailsUrl + "&" + url;
%>

<a href="<%= detailsUrl %>">


 

<trp:displayProductEvent>

The <trp:displayProductEvent> tag (Table 5-4) is used to generate a behavior event when a user has received (viewed) a product impression, (typically a gif image).

At least one of sku, categoryId, or documentId is required.

Use the following code to import the product events tag library:
<%@ taglib uri="productTracking.tld" prefix="trp" %>

Table 5-4 <trp:displayProductEvent>

Tag Attribute

Req'd

Type

Description

R/C

applicationName

No

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

R

categoryId

No

String or Category object

Category of the product associated with the content displayed, if applicable.

R

documentId

No

String

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

R

documentType

No

String

Type or category of the item that is displayed (if applicable).

Suggestions:
DisplayProductEvent.CATEGORY_BROWSE

DisplayProductEvent.ITEM_BROWSE

DisplayProductEvent.CATEGORY_VIEW

DisplayProductEvent.BANNER_AD_PROMOTION

R

sku

No

String or ProductItem object

ID of the product associated with the content item that is displayed, if applicable.

R


 

Example

The example below shows a code snippet of processing that would follow the retrieval of a catalog item. The <tr:displayProductEvent> tag generates an event and passes the document's ID, type and SKU number of the product item.

<%@ taglib uri="productTracking.tld" prefix="trp" %>
.
.
.
<trp:displayProductEvent
documentId="<%= item.getName() %>"
documentType="<%= DisplayProductEvent.ITEM_BROWSE %>"
sku="<%= item.getKey().getIdentifier() %>" />

<trc:clickCampaignEvent>

The <trc:clickCampaignEvent> tag (Table 5-5) is used to explicitly generate a clickthrough event relevant to a campaign. A clickthrough is when a user clicks on an advertisement's content. This tag will return a URL query string containing event parameters. It is then used when forming the complete URL that hyperlinks the content.

Note: The <ph:placeholder> tag is the principal means used to generate campaign click and display events on ads, which it does implicitly.

Use the following code to import the campaign events tag library:
<%@ taglib uri="campaignTracking.tld" prefix="trc" %>

Table 5-5 <trc:clickCampaignEvent>

Tag Attribute

Req'd

Type

Description

R/C

campaignId

No

String

ID of the associated campaign.

R

applicationName

No

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

R

documentId

Yes

String

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

R

documentType

No

String

Type or category of the item that is displayed, if applicable.

R

id

No

String

Page variable which will hold the output of this tag.

C

placeholderId

No

String

Name of the placeholder.

R

redirectURL

Yes

String

Where the server should redirect the client to after the document is clicked on and after the server processes the clickthrough event.

R

scenarioId

No

String

ID of the scenario assoicated with a campaign.

R

userId

No

String

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

R


 

Example

The example below shows a code snippet of processing that generates the query string to be included in a campaign item hyperlink. Processing of the redirectURL attribute is analagous to the use of the <tr:clickContentEvent> tag.

<%@ taglib uri="campaignTracking.tld" prefix="trc" %>
.
.
.
<trc:clickCampaignEvent
id="url"
campaignId="<%=campaignId%>"
placeholderId="<%=placeholderId%>"
applicationName="myAppName"
userId="<%=request.getRemoteUser()%>"/>

 

back to top previous page