Introduced in Feature Pack 1

Sample e-Marketing Spot JSP snippets and the web activities they support

Many WebSphere Commerce starter store pages contain e-Marketing Spots that display marketing information using web activities. If you are adding e-Marketing Spots to a store page, you can review one of the starter store e-Marketing Spot snippets that provides the functions and parameters you need. You can then use the snippet as a starting point for your store.

A store page JSP file can include one or more e-Marketing Spot snippets. Each included snippet represents an e-Marketing Spot. The snippet that is selected for the e-Marketing Spot depends on several factors: the location of the e-Marketing Spot on the page, the type of web activity that runs in the e-Marketing Spot, and whether the e-Marketing Spot requires added features, such as scrolling or pagination. A single snippet is often reused on more than one store page, or multiple times on the same store page.

The following e-Marketing Spot JSP snippets are used in the WebSphere Commerce starter stores to call the marketing services and return data to an e-Marketing Spot:

  1. ContentAreaESpot.jsp – A basic snippet that is formatted for the main content area.
  2. ESpotNavDisplay.jsp – A basic snippet that is formatted for the sidebar.

    Feature Pack 1The ESpotNavDisplay.jsp snippet also supports a specialized JSP fragment ESpotNavDisplayBrazilExt.jspf. This fragment adds more promotion-related functions to an e-Marketing Spot to support web activities that use the Display Promotional Price action or the Promotion Checker target.

  3. Feature Pack 1ScrollingProductsESpot.jsp – A snippet that displays a scrolling list of catalog entries.
  4. Feature Pack 1BrowsingHistoryESpotDisplay.jsp – A snippet that displays a paginated list of catalog entries.
  5. Feature Pack 3IntelligentOfferESpot.jsp – A snippet that displays dynamic recommendations for IBM Product Recommendations, formerly known as Coremetrics Intelligent Offer.
These snippets are installed at the following path when you publish a starter store archive, if the snippet is used in the starter store:
  • WebSphere Commerce DeveloperWCDE_installdir/workspace/Stores/WebContent/storedir/Snippets/Marketing/ESpot
  • WebSphere Commerce EnterpriseWebSphere Commerce ProfessionalWebSphere Commerce - ExpressWC_eardir/Stores.war/storedir/Snippets/Marketing/ESpot
In addition to the snippets listed previously, WebSphere Commerce provides a generic WebServiceeMarketingSpotDisplay.jsp snippet. This snippet is a simplified e-Marketing Spot snippet that can be used as a starting point for any basic e-Marketing Spot (in fact, all the snippets previously listed evolved from this snippet). This WebServiceMarketingSpotDisplay.jsp snippet contains sample code that can be used to help you create your e-Marketing Spots and ensure that your e-Marketing Spot supports the available marketing actions. This snippet illustrates how to use the <getData> tag to get data from the Get MarketingSpotData web service, and it provides an example of the data returned. This snippet does not do any formatting, pagination, or scrolling. This snippet is located here:
  • WC_installdir/samples/Snippets/web/Marketing/Campaigns
  • WebSphere Commerce Developer WCDE_installdir/samples/Snippets/web/Marketing/Campaigns
Feature Pack 6 or laterThere is also a eMarketingSpotProperties.jsp e-Marketing Spot snippet. This snippet is provided to help you create or update your e-Marketing Spot snippets to handle information that is returned as custom e-Marketing Spot properties when your e-Marketing Spot displays a web activity that includes the e-Marketing Spot Properties action. This snippet does not do any formatting, pagination, or scrolling. This snippet is located here:
  • WC_installdir/samples/Snippets/web/Marketing/Campaigns
  • WebSphere Commerce Developer WCDE_installdir/samples/Snippets/web/Marketing/Campaigns

To learn more about any snippet, open the snippet in your development environment where you have the starter store published. Then, read the comments in the code that provide examples of how to include the snippet on a store page and what the mandatory and optional parameters are. You can also open a starter store JSP page that includes the snippet and look at the code that specifies the parameters that are used for the snippet on that page.

The following section provides an overview of each snippet, and identifies a starter store page that uses the snippet.

ContentAreaESpot.jsp

This JSP snippet displays a basic e-Marketing Spot, formatted to fit in the main content area of a store page. The code in this JSP snippet can retrieve the following types of data from the Get MarketingSpotData service:
  • Catalog entries
  • Categories
  • Content, such as an advertisement

This snippet can display more than one data type at the same time. For example, you might have three web activities that are running in the e-Marketing Spot: the first displays catalog entries, the second displays categories, and the third displays content. If so, this snippet can display the catalog entries, categories, and content at the same time.

Example of a starter store page that includes this JSP snippet Web activity actions that this snippet can support
Madisons–Department page: The ContentAreaESpot.jsp snippet is included several times on this page to display different data types.

ESpotNavDisplay.jsp

This snippet displays a basic e-Marketing Spot, formatted to fit in the sidebar of a store page. The code in this JSP snippet can retrieve the following types of data from the Get MarketingSpotData service:
  • Catalog entries
  • Categories
  • Content, such as an advertisement

This snippet can display more than one data type at the same time. For example, you might have three web activities that are running in the e-Marketing Spot: the first displays catalog entries, the second displays categories, and the third displays content. If so, this snippet can display the catalog entries, categories, and content at the same time.

Example of a starter store page that includes this JSP snippet Web activity actions that this snippet can support
Madisons–Catalog: Overall layout: The ESpotNavDisplay.jsp snippet is used for several e-Marketing Spots that display in the sidebar of the store.
Feature Pack 1

ScrollingProductsESpot.jsp

This snippet is used to display list of scrollable catalog entries or categories, within a scrollable pane widget in an e-Marketing Spot on a store page. This snippet creates a Dojo ContentPane widget for each catalog entry or category that the Get MarketingSpotData service returns. Then, the scrollable pane widget produces the scrolling effect. For information about the scrollable pane widget, see wc.widget.ScrollablePane.

The code in this JSP snippet can retrieve the following types of data from the Get MarketingSpotData service:

  • Catalog entries
  • Categories
Example of a starter store page that includes this JSP snippet Web activity actions that this snippet can support
Madisons–Home

See the e-Marketing Spot named HomePageFeaturedProducts, which displays a scrolling list of catalog entries for a clearance sale.

Feature Pack 1

BrowsingHistoryESpotDisplay.jsp

This snippet displays a paginated list of catalog entries in an e-Marketing Spot on a store page. The code in this JSP snippet can retrieve the following types of data from the Get MarketingSpotData service:
  • Catalog entries only
The snippet is formatted to display in the My Account area of the store, across the full width of a store page (excluding the navigation area in the left sidebar).

The snippet supports controls that customers can use to display the catalog entries as:

  • A grid view
  • A list view
Example of a starter store page that includes this JSP snippet Web activity actions that this snippet can support
Madisons–My Account: Browsing History
Feature Pack 1

ESpotNavDisplayBrazilExt.jspf

This is a specialized JSPF snippet that extends ESpotNavDisplay.jsp to add more promotion-related functions to an e-Marketing Spot demonstrated on the Brazil starter store.

This snippet is used to display the following two types of web activities:

  1. Web activities that use the Display Promotional Price action to calculate and display the discounted price of the catalog entry that the customer is viewing, as well as the short description of the promotion that is specified in the web activity.
  2. Web activities that use the Promotion Checker target to determine whether a catalog entry that a customer is viewing qualifies for the promotion that is specified in the web activity.

This JSPF snippet supports a number of specialized functions to display promotion-related data in an e-Marketing Spot. For example, this snippet supports a parameter, currentProductId, to pass the product ID of the product that the customer is viewing into the e-Marketing Spot. This parameter is required to determine whether the product qualifies for the promotion that is specified in the web activity. To learn more about the additional promotion-related functions this snippet supports, see the comments included in the snippet.

Important: This JSPF snippet is included only in the Brazil starter store. To access the snippet, you can either publish the Brazil starter store, or get the snippet directly out of the Brazil.sar store archive file, which installs at this path:

WebSphere Commerce DeveloperWCDE_installdir/starterstores/brazil-solution/Brazil.sar

Within the Brazil.sar store archive, the snippet is here:

WebSphere Commerce Developer/StoreAssetsDir/Snippets/Marketing/ESpot/ESpotNavDisplayBrazilExt.jspf

Example of a starter store page that includes this JSPF snippet Web activity actions that this snippet can support
Brazil–Home: There are several e-Marketing Spots on this page that use this JSPF snippet:
  • BrazilFeaturedNonPaymentPromotion

    (displays a web activity that uses the Display Promotional Price action to display a category promotion discount)

  • BrazilFeaturedPaymentPromotion

    (displays a web activity that uses the Display Promotional Price action to display a payment promotion discount)

  • BrazilFeaturedShippingPromotion

    (displays a web activity that uses the Promotion Checker target with the Display Content action)

Action: Display Promotional Price

Also:

Action: Recommend Content when used with the Target: Promotion Checker target

Feature Pack 3

IntelligentOfferESpot.jsp

This is a specialized snippet that has an added function to include a refresh area that can display dynamic recommendations from IBM Product Recommendations. You can also use this snippet to display WebSphere Commerce recommendations for catalog entries, categories, and content because the snippet is based on the ContentAreaESpot.jsp e-Marketing Spot JSP snippet.
Example of a starter store page that includes this JSP snippet Web activity actions that this snippet can support
Madisons–Product Details page: The IntelligentOfferESpot.jsp snippet is included on this page to display dynamic recommendations for the product that the customer is viewing.

Plus: the same list of web activities that the ContentAreaESpot.jsp e-Marketing Spot JSP snippet supports.

For more information, see IBM Product Recommendations in the Madisons and Elite starter stores.