---
title: Overview
slug: template-js/modify-recommendations
docTags: 
createdAt: 2022-06-10T17:15:03.000Z
---



# Modify Recommendations&#x20;

:::hint{type="info"}
This guide is for working with the Klevu API Request and Response data for Klevu Smart Recommendations.  Direct editing of the display markup is achieved within the Klevu Merchant Center.

Please review the Knowledge Base article for more details on [how to work with the Recs Template Editor](https://help.klevu.com/support/solutions/articles/5000871328-templates)
:::



It is possible to modify the Klevu Recommendations query, response, or template data for any or all of your Recommendation banners. You can do this by adding one or more of the following hook functions, after the Klevu initialization.

Within each of these hook functions, you will find relevant objects and variables that you can use to modify the default behavior provided by Klevu. 

**Note:** the `recsKey` value is the `id` provided with each Recommendation banner. This value can be used to specifically target a specific banner for modification.

## Modify Recs Request

Any of the [Klevu API parameters](https://docs.klevu.com/apis/smart-search) are available to be applied as needed or otherwise to override any default values within the `recordQueries` object

:::BlockQuote
function klevu\_processRECSRecordQueries(recordQueries, recsKey) \{
&#x20; console.log(recordQueries, recsKey);
}
:::



## Modify Recs Response

Any of the *product* attributes are available to be modified as needed or otherwise inject any custom values via `queryResults`

:::BlockQuote
function klevu\_processRECSQueryResults(queryResults, recsKey) \{
&#x20; console.log(queryResults, recsKey);
}
:::



## Modify Recs Template Data

Any of the *template* attributes are available to be modified as needed or otherwise inject any custom values via `templateData`

:::BlockQuote
function klevu\_processRECSTemplateData(templateData, recsKey) \{
&#x20; console.log(templateData, recsKey);
}
:::



## After Recs Render

After the Recommendations template renders, any custom JavaScript action can be executed

:::BlockQuote
function klevu\_bindRECSTemplateElementEvents(templateData, recsKey) \{
&#x20; console.log(templateData, recsKey);
}
:::



## Recs Item Click Event

OnClick of an item within the Recommendations banner any custom JavaScript action can be executed

:::BlockQuote
function klevu\_RECSItemClick(templateData, itemId, recsKey) \{
&#x20; console.log(templateData, itemId, recsKey);
}
:::



## Examples

Please see the Modify Recommendations [Examples](docId\:dX6yJaCsBv_cXuXcrcZJI) section for details of common uses.



