Settings

To power up Klevu there is one snippet of code containing some configuration, which looks something like the following. There are numerous settings available within this options JSON, and we will introduce the most common ones and their use-cases on this page.

<script type="text/javascript">
    klevu.interactive(function () {
        var options = {
            url : {
                search: 'https://eucs3v2.ksearchnet.com/cs/v2/search',
                landing: '/search-results',
                queryParam: 'q'
            },
            search: {
                apiKey: "klevu-12345",
                searchBoxSelector: "input#klevu-search",
                showQuickOnEnter: false,
                minChars: 3
            },
            recs: {
                apiKey: 'klevu-12345'
            },
            analytics: {
                apiKey: 'klevu-12345'
            },
            powerUp: {
                recsModule: true
            }
        };
        klevu(options);
    });
</script>

url > search
This is your Klevu APIv2 Cloud Search URL. You can find this via the Klevu Merchant Centre (KMC) by navigating to Shop Info.

url > landing
The URL of your Search Results Landing Page (SRLP).

url > queryParam (default: q)
The query parameter used by Klevu when a search is submitted, which is appended to the SRLP URL, eg /search-results/?q=bag.

search > apiKey
Your Klevu JS Api Key which will be used for search requests. You can find this via the Klevu Merchant Centre (KMC) by navigating to Shop Info. This will look like klevu-12345.

search > searchBoxSelector (default: input#klevu-search)
The CSS selector used to find your search input field. When the customer starts typing a search query within this input field, the Klevu quick search will appear.

search > showQuickOnEnter (default: false)
Disable the enter/return key in the quick search. Useful for full page quick search overlays, when you do not want to redirect the customer to a search results page.

search > minChars (default: 3)
The CSS selector used to find your search input field. When the customer starts typing a search query within this input field, the Klevu quick search will appear.

recs > apiKey
Your Klevu JS Api Key which will be used for analytics reporting. You can find this via the Klevu Merchant Centre (KMC) by navigating to Shop Info. This will look like klevu-12345.

analytics > apiKey
Your Klevu JS Api Key which will be used for analytics reporting. You can find this via the Klevu Merchant Centre (KMC) by navigating to Shop Info. This will look like klevu-12345.

powerUp > recsModule (default: false)
Whether or not to power up Klevu Recommendations functionality.