Enabling the Cookie Contents target in JSP-based stores
In order to use the Cookie Contents target in web activities, you must modify the JavaServer Page (.JSP) file for the e-Marketing Spot widget.
Procedure
-
Find the name and location of the JSP file for the e-Marketing Spot used in the
web activity.
Note:
- For espots that use the Commerce Composer widgets, the espot widget
code itself can be modified as
follows:
crs-web\WebContent\Widgets_801\com.ibm.commerce.store.widgets.EMarketingSpot\EMarketingSpot_Data.jspf
- While this default code can be customized for testing purposes, it is advised to follow the process for customizing an existing widget as mentioned in Customizing an existing widget.
- For espots that use the webservice based WebServiceeMarketingSpotDisplay.jsp file, refer to Adding an e-Marketing Spot to a JSP store page
- For espots that use the Commerce Composer widgets, the espot widget
code itself can be modified as
follows:
- Open the JSP file for the e-Marketing Spot in which you plan to display the targeted marketing content in any editor tool.
-
Locate the
</wcf:getData>
or</wcf:rest>
tag. -
Add a line of code to the e-Marketing Spot JSP file to pass the cookie name and
value to the marketing services within the tag.
For example, if the name of the cookie is ZIPCODE, then the line of code will be:
<wcf:param name="ZIPCODE" value="${cookie.ZIPCODE.value}" />
-
Alternatively, you can add lines of code to the JSP file to pass all cookie
names and values to the marketing services; however, this is not the preferred
method because a large amount of unnecessary data is passed. For this method,
the lines of code to add to the e-Marketing Spot JSP file look like this:
<c:forEach var="cookieEntry" items="${cookie}"> <wcf:param name="${cookieEntry.key}" value="${cookieEntry.value.value}" /> </c:forEach>
- Save and close the JSP file.