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

To use the Cookie Contents target in Web activities, 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 starting

We need the following information:


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, we 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.