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
- Determine on which JSP files the e-Marketing Spot is to display. You can add the e-Marketing Spot to multiple JSP files.
- Determine where on each JSP file to place the e-Marketing Spot.
-
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
- Customize your new e-Marketing Spot JSP file to fit the layout of your existing store JSP files.
-
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.
-
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:
If you are not using JSTL, use the<c:import url="${jspStoreDir}include/WebServiceeMarketingSpotDisplay.jsp"> <c:param name="emsName" value="ShoppingCartPage" /> <c:param name="catalogId" value="${WCParam.catalogId}" /> </c:import>
<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. - If you require more than one e-Marketing Spot for a JSP file, repeat steps 2 - 6.
- 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.