Guide
Dashboard/KMC Settings
Banners
1 min
{ "tab" "examples", "url" "https //js klevu com/klevu js v1/klevu js api/{{js api key}} banner json", "name" "banners", "method" "get", "request" { "pathparameters" \[], "queryparameters" \[], "headerparameters" \[], "bodydataparameters" \[ { "kind" "required", "name" "js api key", "type" "string", "description" "your public klevu js api key \n" } ], "formdataparameters" \[] }, "results" { "languages" \[ { "id" "y1vx38kzqptilmsufafm ", "code" "{\n \\"klevu banner\\" \[\n {\n \\"showforterms\\" null,\n \\"showonlandingpage\\" true,\n \\"redirecturl\\" \\"https //demo ksearchmisc com/klevusearch/home decor html\\",\n \\"showonquicksearch\\" true,\n \\"enddate\\" \\"2021/08/18\\",\n \\"bannername\\" \\"disney plus\\",\n \\"position\\" \\"bottom\\",\n \\"bannerref\\" 8840,\n \\"bannerimg\\" \\"https //www denofgeek com/wp content/uploads/2019/11/disney plus free trial banner jpg\\",\n \\"showoncategorypage\\" false,\n \\"startdate\\" \\"2021/8/17\\"\n }\n ]\n}", "language" "200", "customlabel" "" } ], "selectedlanguageid" "y1vx38kzqptilmsufafm " }, "examples" { "languages" \[ { "id" "3adeysjml2tq9wyhsdiju", "code" "curl location request get 'https //js klevu com/klevu js v1/klevu js api/klevu 1234567890 banner json'", "language" "curl", "customlabel" "" } ], "selectedlanguageid" "3adeysjml2tq9wyhsdiju" }, "description" "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 ", "currentnewparameter" { "label" "body parameter", "value" "bodydataparameters" } } { "name" "reporting banner click events", "method" "get", "url" "https //stats ksearchnet com/analytics/datatracking", "description" "utilize the following api endpoint to submit the click events for banners ", "tab" "examples", "examples" { "languages" \[ { "id" "bpv9nsmp jafwiozwzlsf", "language" "curl", "code" "curl location request get 'https //stats ksearchnet com/analytics/datatracking?klevu term=tee\&klevu bannerid=12463\&klevu image=http%3a%2f%2fmagento243eep1new\ com%2fmedia%2fcatalog%2fproduct%2fcache%2f860616d0cbe1eba675de08cae449bd25%2fm%2fj%2fmj08 gray main 1 jpg\&klevu target=http%3a%2f%2fmagento243eep1new\ com%2fmedia%2fcatalog%2fproduct%2fcache%2f860616d0cbe1eba675de08cae449bd25%2fm%2fj%2fmj08 gray main 1 jpg\&klevu request=click\&type=banner\&klevu apikey=klevu 1234567890'", "customlabel" "" }, { "id" "thp oy0xlpmn0q unk wn", "language" "php", "code" "\<?php\n\n$curl = curl init();\n\ncurl setopt array($curl, array(\n curlopt url => 'https //stats ksearchnet com/analytics/datatracking?klevu term=tee\&klevu bannerid=12463\&klevu image=http%3a%2f%2fmagento243eep1new\ com%2fmedia%2fcatalog%2fproduct%2fcache%2f860616d0cbe1eba675de08cae449bd25%2fm%2fj%2fmj08 gray main 1 jpg\&klevu target=http%3a%2f%2fmagento243eep1new\ com%2fmedia%2fcatalog%2fproduct%2fcache%2f860616d0cbe1eba675de08cae449bd25%2fm%2fj%2fmj08 gray main 1 jpg\&klevu request=click\&type=banner\&klevu apikey=klevu 1234567890',\n curlopt returntransfer => true,\n curlopt encoding => '',\n curlopt maxredirs => 10,\n curlopt timeout => 0,\n curlopt followlocation => true,\n curlopt http version => curl http version 1 1,\n curlopt customrequest => 'get',\n));\n\n$response = curl exec($curl);\n\ncurl close($curl);\necho $response;\n", "customlabel" "" }, { "id" "nbldpqh5907clqms5b6mz", "language" "javascript", "code" "var formdata = new formdata();\n\nvar requestoptions = {\n method 'get',\n body formdata,\n redirect 'follow'\n};\n\nfetch('https //stats ksearchnet com/analytics/datatracking?klevu term=tee\&klevu bannerid=12463\&klevu image=http%3a%2f%2fmagento243eep1new\ com%2fmedia%2fcatalog%2fproduct%2fcache%2f860616d0cbe1eba675de08cae449bd25%2fm%2fj%2fmj08 gray main 1 jpg\&klevu target=http%3a%2f%2fmagento243eep1new\ com%2fmedia%2fcatalog%2fproduct%2fcache%2f860616d0cbe1eba675de08cae449bd25%2fm%2fj%2fmj08 gray main 1 jpg\&klevu request=click\&type=banner\&klevu apikey=klevu 1234567890', requestoptions)\n then(response => response text())\n then(result => console log(result))\n catch(error => console log('error', error));", "customlabel" "" }, { "id" "ss golxxsbnfs9s0w39ss", "language" "nodejs", "code" "const axios = require('axios');\nconst formdata = require('form data');\nlet data = new formdata();\n\nlet config = {\n method 'get',\n maxbodylength infinity,\n url 'https //stats ksearchnet com/analytics/datatracking?klevu term=tee\&klevu bannerid=12463\&klevu image=http%3a%2f%2fmagento243eep1new\ com%2fmedia%2fcatalog%2fproduct%2fcache%2f860616d0cbe1eba675de08cae449bd25%2fm%2fj%2fmj08 gray main 1 jpg\&klevu target=http%3a%2f%2fmagento243eep1new\ com%2fmedia%2fcatalog%2fproduct%2fcache%2f860616d0cbe1eba675de08cae449bd25%2fm%2fj%2fmj08 gray main 1 jpg\&klevu request=click\&type=banner\&klevu apikey=klevu 1234567890',\n headers { \n data getheaders()\n },\n data data\n};\n\naxios request(config)\n then((response) => {\n console log(json stringify(response data));\n})\n catch((error) => {\n console log(error);\n});\n", "customlabel" "" }, { "id" "on1k3ew foovekeyuj9zw", "language" "java", "code" "okhttpclient client = new okhttpclient() newbuilder()\n build();\nmediatype mediatype = mediatype parse(\\"text/plain\\");\nmediatype json = mediatype parse(\\"application/json; charset=utf 8\\");\nrequestbody body = requestbody create(json, \\"{}\\");\nrequest request = new request builder()\n url(\\"https //stats ksearchnet com/analytics/datatracking?klevu term=tee\&klevu bannerid=12463\&klevu image=http%3a%2f%2fmagento243eep1new\ com%2fmedia%2fcatalog%2fproduct%2fcache%2f860616d0cbe1eba675de08cae449bd25%2fm%2fj%2fmj08 gray main 1 jpg\&klevu target=http%3a%2f%2fmagento243eep1new\ com%2fmedia%2fcatalog%2fproduct%2fcache%2f860616d0cbe1eba675de08cae449bd25%2fm%2fj%2fmj08 gray main 1 jpg\&klevu request=click\&type=banner\&klevu apikey=klevu 1234567890\\")\n method(\\"get\\", body)\n build();\nresponse response = client newcall(request) execute();", "customlabel" "" } ], "selectedlanguageid" "on1k3ew foovekeyuj9zw" }, "results" { "languages" \[ { "id" "ebsih3ekwmqpzne3itocf", "language" "200", "customlabel" "", "code" "\<data>\n \<response>success\</response>\n\</data>" } ], "selectedlanguageid" "ebsih3ekwmqpzne3itocf" }, "request" { "pathparameters" \[], "queryparameters" \[ { "name" "klevu term", "kind" "required", "type" "string", "description" "this field refers to the search term used when submitting banner click events when submitting click events on category pages, you can indicate that it is a banner click event by using an asterisk ( ) in place of the actual search term this helps differentiate it from regular search term submissions ", "children" \[] }, { "name" "klevu bannerid", "kind" "required", "type" "number", "description" "this will be bannerref value as shown in above api call response ", "children" \[] }, { "name" "klevu image", "kind" "required", "type" "string", "description" "this is the banner image url ", "children" \[] }, { "name" "klevu target", "kind" "required", "type" "string", "description" "this is target url ", "children" \[] }, { "name" "klevu request", "kind" "required", "type" "string", "description" "the value of this field will be “click“ ", "children" \[] }, { "name" "type", "kind" "required", "type" "string", "description" "the value of this field will be “banner“ ", "children" \[] }, { "name" "klevu apikey", "kind" "required", "type" "string", "description" "this is your klevu js api key ", "children" \[] }, { "name" "klevu bannername", "kind" "optional", "type" "string", "description" "this is banner name ", "children" \[] } ], "headerparameters" \[], "bodydataparameters" \[], "formdataparameters" \[] }, "currentnewparameter" { "label" "query parameter", "value" "queryparameters" } }