For dynamic recommendations: Adding e-Marketing Spots to support
Procedure
-
Go to the following directory:
- WCDE_installdir/components/samples/IntelligentOffer
Directory Description javascript Contains the JavaScript files that are required for recommendations from IBM Product Recommendations. Snippets Contains the e-Marketing Spot snippet files that are required for recommendations from IBM Product Recommendations. -
Copy everything inside the javascript directory to the following
directory:
- WC_eardir/Stores.war/Madisons/javascript
workspace_dir/Stores/WebContent/Madisons/javascript
File Description IntelligentOffer.js
This file provides methods to manage the refresh area that is used to display dynamic recommendations. This file also contains the zone population function
io_rec_zp. This function is called by when it has a list of part numbers to display in an e-Marketing Spot. The refresh area is then called with the list of part numbers. The JSP associated with the refresh area loads the necessary information to display each catalog entry. If you have configured to return all the required information to display a catalog entry, then modify this function to remove the call to the refresh area, and create and display the appropriate HTML based on the information that provides. The zone population function is also set up to display the Zone Header Text defined in the Recommendation Plan. This text is displayed at the top of the e-Marketing Spot, for example, "Other Customers Also Bought." Alternatively, you can specify text using the espotTitle parameter when including the e-Marketing Spot snippet. -
Copy everything inside the Snippets directory to the following
directory:
- WC_eardir/Stores.war/Madisons/Snippets/Marketing/ESpot
workspace_dir/Stores/WebContent/Madisons/Snippets/Marketing/ESpot
File Description IntelligentOfferESpot.jsp
An e-Marketing Spot snippet that has an added function to include a refresh area that can display dynamic recommendations from . You can also use this snippet to display recommendations for catalog entries, categories, and content because the snippet is based on the ContentAreaESpot.jsp e-Marketing Spot JSP snippet that is used for other starter store e-Marketing Spots.
IntelligentOfferDisplayPartnumbers.jsp
This JSP file is associated with the e-Marketing Spot refresh area. The JSP file sets up a scrollable widget to display dynamic recommendations for catalog entries.
IntelligentOfferDisplayPartnumber.jsp
This JSP file finds the catalog entry ID associated with a part number and uses CatalogEntryThumbnailDisplay.jsp to display the catalog entry. JSP caching can be used for this JSP file to improve runtime performance.
-
Edit the IntelligentOfferESpot.jsp file to specify that communication
should be with the IBM Product Recommendations
production or test server:
-
Update applicable store pages to include a e-Marketing Spot. Examples are
provided for the following scenarios:
- On the product display page, display dynamic recommendations for the currently viewed product
- On the category display page, display top seller dynamic recommendations for the currently viewed category
- On the home page, display top seller dynamic recommendations for the site
- On the shopping cart page, display dynamic recommendations for the most recently viewed product
- On the order summary page, display dynamic recommendations for the most recently purchased product
-
Optional: For dynamic recommendations, consider caching the JSP snippets that display an
individual catalog entry recommendation in the e-Marketing Spot. The following example illustrates
how to cache the corresponding JSP snippets:
<cache-entry> <class>servlet</class> <name>/Madisons/Snippets/Marketing/ESpot/IntelligentOfferDisplayPartnumber.jsp</name> <property name = "do-not-consume">true</property> <property name = "save-attributes">false</property> <cache-id> <component id = "emsName" type = "parameter"> <required>true</required> </component> <component id = "catalogId" type = "parameter"> <required>true</required> </component> <component id = "DC_storeId" type = "attribute"> <required>true</required> </component> <component id = "DC_lang" type = "attribute"> <required>true</required> </component> <component id = "DC_curr" type = "attribute"> <required>true</required> </component> <component id = "DC_cont" type = "attribute"> <required>true</required> </component> <component id = "DC_mg" type = "attribute"> <required>true</required> </component> <component id = "intv_id" type = "parameter"> <required>true</required> </component> <component id = "experimentId" type = "parameter"> <required>false</required> </component> <component id = "testElementId" type = "parameter"> <required>false</required> </component> <component id = "partNumber" type = "parameter"> <required>true</required> </component> </cache-id> </cache-entry> <!--**************************************************************************************************** --> <!--* Each individual catalog entry display snippet should be cached for the related eMarketing spots. * --> <!--* All eMarketing spot jsps wrap around this snippet, hence each piece of its content is cached * --> <!--* even though the eMarketing spot itself is not cached. * --> <!--**************************************************************************************************** --> <cache-entry> <class>servlet</class> <name>/Madisons/Snippets/Catalog/CatalogEntryDisplay/CatalogEntryThumbnailDisplay.jsp</name> <property name = "do-not-consume">true</property> <property name = "save-attributes">false</property> <cache-id> <component id = "emsName" type = "parameter"> <required>true</required> </component> <component id = "catalogId" type = "parameter"> <required>true</required> </component> <component id = "DC_storeId" type = "attribute"> <required>true</required> </component> <component id = "DC_lang" type = "attribute"> <required>true</required> </component> <component id = "DC_curr" type = "attribute"> <required>true</required> </component> <component id = "DC_cont" type = "attribute"> <required>true</required> </component> <component id = "DC_mg" type = "attribute"> <required>true</required> </component> <component id = "intv_id" type = "parameter"> <required>true</required> </component> <component id = "experimentId" type = "parameter"> <required>false</required> </component> <component id = "testElementId" type = "parameter"> <required>false</required> </component> <component id = "catEntryIdentifier" type = "parameter"> <required>true</required> </component> </cache-id> <dependency-id> storeId:productId <component id = "storeId" type = "parameter"> <required>true</required> </component> <component id = "catEntryIdentifier" type = "parameter"> <required>true</required> </component> </dependency-id> <dependency-id> productId <component id = "catEntryIdentifier" type = "parameter"> <required>true</required> </component> </dependency-id> <dependency-id> activityId <component id = "intv_id" type = "parameter"> <required>true</required> </component> </dependency-id> <dependency-id>RankingEMarketingSpot</dependency-id> </cache-entry>
What to do next
To test your dynamic recommendations:
- For each of the new IBM Product Recommendations e-Marketing Spots you added to store pages in this task, create the e-Marketing Spot in Management Center so that you can use it in web activities. See Creating an e-Marketing Spot.
- Create a web activity to display the recommendations in the e-Marketing Spot by using the
Display action:
- For an overview and examples, see Action: Display.
- For general instructions on creating web activities, see Creating a web activity.
