Modifying the e-Marketing Spot JSP file to support the Cookie Contents target

To use the Cookie Contents target in Web activities, you must add some code to the JSP file for the e-Marketing Spot in which you plan to display the targeted marketing content. This additional code retrieves the specified cookie name and value for each customer who views the page and passes these parameters to the marketing services. The marketing services will display the targeted marketing content to the customer if the cookie name and value matches the criteria set for the target in the Web activity.

Before you begin

You need the following information:
  • The name of the cookie used in the target.
  • The name and location of the JSP file for the e-Marketing Spot used in the Web activity.

Procedure

  1. In an editor, open the JSP file for the e-Marketing Spot in which you plan to display the targeted marketing content.
  2. Locate the </wcf:getData> or </wcf:rest> tag.
  3. Within the tag, add a line of code to the e-Marketing Spot JSP file to pass the cookie name and value to the marketing services.

    For example, if the name of the cookie is ZIPCODE, then the line of code looks like this:

    <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>
  4. Save and close the JSP file.