Develop > Presentation layer > Work with Web service feeds
Pass custom parameters to an e-Marketing Spot Atom feed
If the default parameters supported for Web service feed URLs do not meet the needs, you can define custom parameters.
To do so, extend the Java class that handles Atom feeds for the MarketingSpotData noun. By customizing the business logic in the class, you can pass custom parameter values directly to the marketing services.
Before you begin
For a list of default parameters supported for Web service feed URLs, see:URL structure for Web service feeds
To understand the framework that supports Web service feeds, see:
Overview of the RESTful Web service framework for feeds
By default, e-Marketing Spot feed URLs support a set of parameters that allow you to control the behavior of the Atom feed. For example, you can specify the language of the feed content and the maximum number of products to display in the feed. The Java class that handles these parameters ignores any unsupported parameters passed on the URL, to avoid unexpected behavior or malicious parameters.
To support any additional parameters, do the customization tasks described in this section.
Example
You want to customize an e-Marketing Spot feed so that it displays different content depending on a certain parameter and value in the URL. The parameter, loyaltyId, indicates the customer's loyalty program level. After the customization is in place, to create personalized Web activities to recommend products to customers based on their loyalty program level. For example:
Loyalty program level Loyalty program values Recommended product Gold (Big Spender) Start with 100- Executive Six-Drawer Desk Silver (Bargain Hunter) Start with 200- Craft Table Not a loyalty member No value Student's Desk
To support this custom parameter, extend the MarketingSpotData Java class that handles Atom feeds for e-Marketing Spots so that the class passes the loyaltyId URL parameter to the marketing services. The Web activity can then display the correct recommended product based on the value of the loyaltyId URL parameter.
- Extend the Atom feed Java class to support the new parameter
Create a Java class that extends from the MarketingSpotData Java class.To add the business logic required to support the custom parameter, override the buildMarketingTriggerParameters method in the class. The new class must detect the custom parameter in the URL. If the parameter is present, the new class must add the parameter and value to the list of trigger parameters passed to the marketing services.
- Customize the store JSP file to pass the custom parameter to the Atom feed URL
Your custom parameter must be included in the e-Marketing Spot feed URL so that the new Java class can detect the parameter and pass it to the marketing services. The following procedure provides an example of how you can pass the custom parameter to the feed URL using the Madisons starter store pages. This involves adding code to the RemoteWidgetButtons.jsp file, which is used in the Madisons starter store for the Share and Subscribe links for e-Marketing Spot feeds and remote widgets.
Related concepts
Related reference
URL structure for Web service feeds