Adding an e-Marketing Spot to a store page

You can create a custom JSP file to add add a custom e-Marketing Spot to a store page.

Procedure

  1. Determine on which JSP files the e-Marketing Spot is to display. You can add the e-Marketing Spot to multiple JSP files.
  2. Determine where on each JSP file to place the e-Marketing Spot.
  3. Copy the contents of the sample e-Marketing Spot file, WebServiceeMarketingSpotDisplay.jsp, into a new JSP file within your store web application.
    This file is within the following directory in your IBM WebSphere Commerce Developer environment:

    workspace_dir\samples\Snippets\web\Marketing\Campaigns

  4. Customize your new e-Marketing Spot JSP file to fit the layout of your existing store JSP files.
  5. Within the e-Marketing Spot code, specify the e-Marketing Spot name.
    Note: Name e-Marketing Spots descriptively so that the name includes the location and purpose for the spot. For instance, HomePageRow1Ads, or CheckOutPageRecommendation. This naming convention helps to reduce confusion about which page the e-Marketing Spot is on and what it displays. If necessary, add numbers to the name to differentiate between two e-Marketing Spots that appear on the same page. e-Marketing Spot names must be valid Java identifiers. You must use this same name when you register the e-Marketing Spot in the database with the Marketing tool in Management Center.
  6. Add the e-Marketing Spot to the JSP file by dynamically including the e-Marketing Spot with the JSTL <c:import> tag structure with any associated parameters.
    Your code can resemble the following sample code snippet:
      
    <c:import url="${jspStoreDir}include/WebServiceeMarketingSpotDisplay.jsp">
      <c:param name="emsName" value="ShoppingCartPage" />
      <c:param name="catalogId" value="${WCParam.catalogId}" />
    </c:import>
    
    If you are not using JSTL, use the <jsp:include> tag. By using a dynamic include tag to add the e-Marketing Spot to the store JSP, the dynamic caching feature can cache the e-Marketing Spot. To avoid running the e-Marketing Spot snippet for each page load, use the e-Marketing Spot JSP caching technique based on activity behavior. For more information, see Overview of e-Marketing Spot JSP caching based on activity behavior.
  7. If you require more than one e-Marketing Spot for a JSP file, repeat steps 2 - 6.
  8. Create the e-Marketing Spot in the Marketing tool to register the spot within the database. For more information, see Creating an e-Marketing Spot.