klevu( options ) Returns: klevu
Description: Settings overrides
Klevu Library has some predefined settings for its powerup and for some of its modules.
The following is a description of the settings that are used in the library.
{ console : { // logging settings, only take effect if using the logging enabled versions active : false , // activate logging errorReporting: "stats.ksearchnet.com", // automatic error reporting level : 1 , // 1: error | 2: warning | 3: info | 4:debug, type : { // module logging general : false , ajax : false , chain : false , translator : false , template : false , event : false , storage : false } } url : { search: url , // cloud search url including protocol landing : landingUrl, // landing page url used protocolFull: protocolUsed //Protocol to be used on generated urls }, currency : { // currency settings precision : 2 , // default precision on numbers is 0 grouping : 3 , // digit grouping decimal : "." , // decimal point separator thousand : "," // thousands separator }, localSettings: true, // set to true to identify that overrides have been done locally, this will force initialization of some modules search : { // the search object settings searchBoxSelector : selectorString , // quick search selector searchBoxTarget: false, // define a target for the results generation, if false target will be build minChars : 0 , // minimum characters for the search to execute placeholder : placeholderText , // placeholder text of the search box, to not fire a search when this text is imputed showQuickOnEnter : false , // avoid redirecting to landing when enter is hit fullPageLayoutEnabled : false, //avoid the focus out event personalisation: false, // controll of personalisation redirects: { // redirects for specific search term "term": "https://full-url.com" }, apiKey: 'klevu-11111111111111111' // store search apiKey }, analytics: { // the analytics object settings apiKey: 'klevu-11111111111111111' // store analytics apiKey } }
All settings for search and analytics object will be set on the base object and used as defaults if no local override of the settings is used.
Example of setting a api key for analytics object
var options = { analytics: { apiKey: 'klevu-11111111111111111' } }; klevu(options);