Adding support for the e-Marketing Spot properties action to an e-Marketing Spot

As a store page developer, you can add support for using the e-Marketing Spot properties action in an e-Marketing Spot. Before this action can be used in a web activity, support for the type of property information that returns to the e-Marketing Spot must be added to the store page that the activity runs on.

By default, there are no properties that are supported for use in the e-Marketing Spot properties action. A store page developer must add support for all properties that are to be used in the e-Marketing Spot properties action. For example, you could define the following as properties for use in an e-Marketing Spot to change how these properties display in your storefront:
  • CSS files
  • JSP pages and JSP fragments
  • Sales catalogs
Note: For a Marketing Manager or business user to be able to use this action in a web activity after you add support, the supported names and corresponding values for a property must be provided to these users.

Before you begin

Before you begin this task, ensure that you complete the following prerequisites:
  • Identify the property information that your Marketing Manager or business user wants to use in the e-Marketing Spot properties action. Ensure that this information, such as a CSS file, JSP file, or JSP fragment, exists for your store.
  • Identify the e-Marketing Spot that is going to be used with the e-Marketing Spot properties action in a web activity.
  • Identify the store page that is going to be used to display the activity.

Procedure

  1. Create, or locate the e-Marketing Spot JSP file that you are adding support for the property information that is being used by a web activity. Open your e-Marketing Spot JSP file for editing.
  2. In your file management program, navigate to the samples directory that contains the sample eMarketingSpotProperties.jsp file. This file contains sample code that illustrates how to support the handling of custom e-Marketing Spot properties that are returned from a web activity that includes the e-Marketing Spot Properties action. Open this file to view its contents.
    This file can be found in the following directory:
    • WC_installdir\components\foundation\samples\Snippets\web\Marketing\Campaigns\
    • WCDE_installdir\components\foundation\samples\Snippets\web\Marketing\Campaigns\
  3. Use this sample JSP file to help customize or create your e-Marketing Spot JSP file to support e-Marketing Spot properties. When you create or customize your JSP file, add your JSP file into your store directory for e-Marketing Spot JSP files.

    For example, WC_eardir\Stores.war\store_dir\Widgets\ESpot\include where store_dir is the directory name for your store.

  4. Locate the JSP file for the store page that is to display the activity and e-Marketing Spot. Open this store page JSP file for editing.
  5. Customize your store JSP file to support the use of your e-Marketing Spot and e-Marketing Spot properties.
    Include the following code to add support for the property that you are returning information for in your e-Marketing Spot.
    <%out.flush();%>
    <c:import url=${env_jspStoreDir}Widgets/ESpot/include/yourESpot.jsp">
    <c:param name="emsName" value="eSpotPropertyName"/>
    </c:import>
    <%out.flush();%>
    Where yourESpot.jsp is the name of the e-Marketing Spot JSP created in step 3. The value eMarketingSpotName is the name of the e-Marketing Spot on which the Marketing Manager should set up the web activity that uses the e-Marketing Spot Properties action. For example, you can set eMarketingSpotName to be Stylesheet if you want to return a CSS style sheet to the e-Marketing Spot to change a style element on the store page.

    The location in the file where you add this code is dependent on the type of property you are adding, and where on the store page you want your change to display. In the examples that are provided, Stylesheet and ExtraWidget are the names of the e-Marketing Spot.

    • For example, if you are returning style sheet information, you can include the following code:
      <%out.flush();%>
      <c:import url=${env_jspStoreDir}Widgets/ESpot/include/yourESpot.jsp">
      <c:param name="emsName" value="Stylesheet"/>
      </c:import>
      <%out.flush();%>
      After the following lines of code in the beginning of your file:
      <!-- Begin Page -->  
      <div id="page">
    • If you are including support to add a widget that is called ExtraWidget, to your store page, include the code to support adding the widget in the location where you want the widget to display. For example, if you want a new widget to display after the main content in your page, but before the page footer content, add the following code:
      <%out.flush();%>
        <c:import url=${env_jspStoreDir}Widgets/ESpot/include/myEMarketingSpot.jsp">
          <c:param name="emsName" value="ExtraWidget"/>
        </c:import>
      <%out.flush();%>
      
      Before the following line of code: <!--End Page Content-->.
  6. Save and close your file.

What to do next

Confirm with your Marketing Manager or business user that they can include the supported properties within an e-Marketing Spot properties action in a web activity and change the storefront behavior when they activate the activity.