Skip to content

Recommendation Lists on Landing Pages

A landing page, such as the homepage or a category page, can include a primary list, recommendation list(s), or both. Including recommendation list(s) can be achieved by supplying a page configuration in the request body and sending a POST-request to the landing-page endpoint, or by configuring a page in the Experience app and sending a GET-request to the landing-page endpoint. For more information, see the Landing page query specification.

Example

Below is an example on how to include recommendation lists on a landing page. The example is for a homepage where two recommendation lists are presented: one to present the TOP_PRODUCTS recommendation and another to present the NEWEST_PRODUCTS recommendation with products that have prices up to $500. For more information about restricting a product selection in a query, see Product Rules. The id:homepage-1 and id: homepage-2 refers to the sections or recommendation lists identifier for that page in the Experience app.

//request-body.json
{ 
  "recommendationLists": [
    {
        "id": "homepage-1",
        "algorithm": "TOP_PRODUCTS"     
    },
    {
        "id": "homepage-2",
        "algorithm": "NEWEST_PRODUCTS",
        "productRules":  "rule incl price [0.00, 500.01]"
    }
  ]  
}
#!/bin/bash
curl -X POST \
"https://{cluster-id}.api.esales.apptus.cloud/api/v2/queries/landing-page?market=US&customerKey=d9528030-509c-4e0f-b585-7168f1e9feca&sessionKey=customerKey=d9528030-509c-4e0f-b585-7168f1e9feca&touchpoint=DESKTOP&pageId=/" \
-H 'Content-Type: application/json' \
-d @request-body.json
const api = esales({ market: 'US', webApiId: 'cluster-id', touchpoint: 'desktop' });
const results = await api.query.landingPage({ pageId: '/' }, 
  {
  recommendationLists: [
    {
      id: 'homepage-1',
      algorithm: 'TOP_PRODUCTS'
    },
    {
      id: 'homepage-2',
      algorithm: 'NEWEST_PRODUCTS',
      productRules: 'rule incl price [0.00, 500.01]'
  } 
  ]
});

Last update: June 27, 2022
×
Copyright

This online publication is intellectual property of Apptus Technologies. Its contents can be duplicated in part or whole, provided that a copyright label is visibly located on each copy and the copy is used in conjunction with the product described within this document.

All information found in these documents has been compiled with utmost attention to detail. However, this does not guarantee complete accuracy. Neither Apptus Technologies nor the authors shall be held liable for possible errors or the consequences thereof.

Software and hardware descriptions cited in these documents might be registered trademarks. All trade names are subject to copyright restrictions and may be registered trademarks. Apptus Technologies essentially adheres to the manufacturer’s spelling. Names of products and trademarks appearing in this document, with or without specific notation, are likewise subject to trademark and trade protection laws and may thus fall under copyright restrictions.

CLOSE