Develop > Presentation layer > Customize marketing


Add an e-Marketing Spot to a store page (WebSphere Commerce Accelerator)


Procedure

  1. Determine on which JSP files the spot will display. The spot can be added to multiple JSP files.

  2. Determine where on the JSP file to place the spot.

  3. Copy the sample e-Marketing Spot in to a new JSP file inside of the store Web application. Deploy the new JSP file.

  4. Customize the sample e-Marketing Spot to fit the layout of the JSP files.

  5. Within the e-Marketing Spot code, give the e-Marketing Spot a name.

    e-Marketing Spots should be descriptively named so as to include their location, such as HomePageAd, or CheckOutPageRecommendation. This helps to reduce confusion about where it will appear, and what content it should contain. If necessary, numbers can be added to the name to differentiate between two e-Marketing Spots appearing on the same page. e-Marketing Spot names must be valid Java identifiers. You must use this same name when registering the e-Marketing Spot in the database using the WebSphere Commerce Accelerator.

  6. Add the e-Marketing Spot to the JSP file by dynamically including the spot using the JSTL <c:import> tag structure with any associated parameters. Your code should look similar to the following:

    <c:import url="../../include/eMarketingSpotDisplay.jsp">   
    <c:param name="emsName" value="StoreHomePage" />   
    <c:param name="maxNumDisp" value="8" />   
    <c:param name="catalogId" value="${WCParam.catalogId}" />   
    <c:param name="maxItemsInRow" value="4" />   
    <c:param name="maxColInRow" value="3" />
    </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 Dynacache feature can be enabled, so that the content of the JSP, excluding the e-Marketing Spot, will be cached. The e-Marketing Spot will be refreshed on every visit, thus displaying the proper dynamic content.

  7. If you require more than one e-Marketing Spot per JSP file, repeat steps 2 through 6.

  8. Create the e-Marketing Spot in the database using the WebSphere Commerce Accelerator.

    1. If you plan to add the store ID, catalog ID, or language ID to the URL using the following convention, "langId=<%= languageId %>", note that the JSP in which the e-marketing spot is embedded must make the appropriate ID available. The IDs can also be retrieved through the command context, for example, getCommandContext().getLanguageId()?).

    2. The URL parameter, CatalogDisplay should start with "&" instead of "?" because the code isn't referencing the command directly.

    3. If a merchandising association activity is being scheduled to the e-Marketing Spot, and the source of the association is based on the content of the page, it can be set using the setSourceCatalogEntryId(String source) and the setMultipleCatalogEntryId(String source) methods provided in com.ibm.commerce.marketing.beans.EMarketingSpot. For example, in the Product Display page, if the product displayed in the page is to be used as the source of the association, the following method will be invoked:

      eSpot.setSourceCatalogEntryId(productId)
      

      where eSpot is an instance of the com.ibm.commerce.marketing.beans.EMarketingSpot class, and productId is the identifier of the source product.

    4. Configure any filters as appropriate. You can apply filters that exclude recommendations for any products or items which may not have sufficient inventory, or which may already be in the customers shopping cart. Filters are applied by adding a string similar to the following to the JSP:

      <c:set var="CATENTRY_NOT_EXPIRED" value="9" />

      For a complete list of the applicable filters, refer to the API information for the EMarketingSpot.

    5. Since spaces available to display marketing content in an e-Marketing Spot might be limited, apply these rules to share spot spaces between normal and experimental activities:

      • Add an optional maximum number of result attributes to the e-Marketing Spot bean for each type of content to allow for content derived from experiments.

      • By default, set the value of these attributes to the same value as normal campaign activities.

      • The maximum number of allowed content from normal campaign activities should be equal to the maximum number of results (for normal campaign activities) minus the number of displayed results from experiments.

Related reference

Example: e-Marketing Spot


+

Search Tips   |   Advanced Search