Configurations
If you haven't gone through the prerequisites and the v2 structure, please have a look at Overview
Merchants can create and manage multiple Klevu Recommendation banners via our KMC (Klevu Merchant Centre). The configuration via KMC includes the page type, the banner type and even the template to render the banner.
Our recommended approach to display these banners created via the KMC is to use our HTML Div Integration approach, which includes handling of API calls and banner rendering out of the box. You can also retrieve the KMC banner configuration via an API call and process it however you like.
This API call uses a simple GET request with no payload, and since it is intended for use on the frontend there is no authentication required
Understanding the response:
Parameters | Description |
metadata.title | The title of the Recommendation Banner, eg. "Our newest arrivals!". |
metadata.recsKey | The unique identifier of the banner. This will match the value of RECS_ID in the request, eg. 3a5580bf-c5b2-407e-acac-4a58ae730b64. |
metadata.pageType | The page type this banner should be displayed on. This will be one of:
|
metadata.logic | The type of recommendation banner which was configured in the KMC. This will be one of: TRENDING TRENDING_PERSONALIZED NEWEST_ARRIVALS RECENTLY_VIEWED HAND_PICKED OTHER_ALSO_VIEWED SIMILAR BOUGHT_TOGETHER |
metadata.maxProducts | The maximum number of products to show within this banner. |
metadata.productThreshold | The minimum number of results before this banner will be displayed. |
metadata.enabled | Whether or not this particular banner is enabled. |
search.basePath | The search URL to be used to send the Recommendation request to, eg. eucs19v2.ksearchnet.com/cs/v2/search. |
search.payload | This correlates to the recordQueries section of the API call to be fired for this Recommendation. |
templates.base | The HTML to be used for rendering the Recommendation banner, in Klevu JavaScript Library markup. |
styles.base | The CSS that is used for rendering the Recommendation banner, in Klevu's Template JS Library markup. |
scripts.recsObject | The Javascript that is executed after the rendering of the HTML Recommendation banner, in Klevu's Template JS Library markup. |
Note regarding the response:
templates.base, styles.base, and scripts.recsObject returned in the configuration API response should not be used when using the API directly since they require the Klevu's Template JS Library.