Guide
Analytics Tracking
Recommendations Events
1 min
tab examples url https analytics url analytics collect name reporting recommendation impressions method post request pathparameters queryparameters headerparameters bodydataparameters kind required name event type string description please use view recs list kind required name event apikey t type string description your klevu js api key eg klevu 12345 kind required name event list id type string description the unique identifier for your kmc recommendations banner eg 12345 abcde this is available in the banner configuration metadata as recskey if you are not using banners configured within the kmc please specify a unique identifier for the banner which will be used to distinguish one banner from another kind required name event list name type string description the name of the banner eg new arrivals this is available in the banner configuration metadata as title kind required name event list logic type string description the logic type of the banner eg newest arrivals this is available in the banner configuration metadata as logic kind optional name event tags type array description this can be used to specify additional information about the event which will eventually be made available within the kmc we recommend you specify the type of page eg home this is available in the banner configuration metadata as pagetype name user profile kind required type object description the json object that holds the user related information such as ip address children name ip address kind required type string description ip address of the shopper who viewed the event n n if calling from javascript this is an optional parameter name ip address v4 kind optional type string description ipv4 address of the shopper who viewed a product name ip address v6 kind optional type string description ipv6 address of the shopper who viewed a product name data protection kind optional type boolean description if set to false klevu s backend do not obtain the shoppers ip address the default value is true name klevu uuid kind optional type string description universally unique identifier generated by klevu it can be also considered as session id please obtain uuid using end point https docs klevu com apis uuid name klevu country kind optional type string description 2 digit country code of the shopper who viewed a product valid codes can be found at https developers google com hotels hotel prices dev guide country codes name klevu city kind optional type string description city name of the shopper who viewed a product kind required name items type array description iterate all of the products in the banner and populate the item data for each kind required name item id type string description the full id of the product eg 12345 54321 this will match the unique value used in your data sync process with klevu for compound products consisting of a child variant and a parent this is usually parentid childid kind required name item group id type string description the parent id of the product eg 12345 for compound products consisting of a child variant and a parent please specify the id of the parent for simple products please re use the same value as item id kind required name item variant id type string description the child id of the product eg 54321 please specify the id of the child variant product for simple products please re use the same value as item id kind required name item name type string description the name of the product kind required name price type number description the final selling price of the product for example 123 45 kind optional name currency type string description the currency of the above price eg usd kind optional name item brand type string description the brand of the product for example nike or acme kind optional name item category type string description the category the item belongs to for nested categories use the ; character to separate the hierarchy and for multiple categories use a double ;; for example for mens shoes trainers and sale you would specify mens;shoes;trainers;;sale kind required name index type integer description the order of the product in the listing starting from 1 formdataparameters results languages id fi7dvhqck3 p270nihihk code language 200 customlabel selectedlanguageid fi7dvhqck3 p270nihihk examples languages id djsrpqrxfqsrjfnj4p wd code ?php n n curl curl init ; n ncurl setopt array curl array n curlopt url https stats ksearchnet com analytics collect 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 post n curlopt postfields n n event view recs list n event apikey klevu 12345 n event list id 12345 abcde n event tags n recspagetype category n n event list name new arrivals n event list logic newest arrivals n user profile n ip address 111 11 11 1 n n items n n item id 12345 54321 n item group id 12345 n item variant id 54321 n item name hoodie sweatshirt n price 123 45 n currency gbp n item brand acme n item category all;;coats jackets;;womens coats n index 1 n n n n n event select recs list n event apikey klevu 12345 n event list id 12345 abcde n event tags n recspagetype category n n event list name new arrivals n event list logic newest arrivals n user profile n ip address 111 11 11 1 n n items n n item id 12345 54321 n item group id 12345 n item variant id 54321 n item name hoodie sweatshirt n price 123 45 n currency gbp n item brand acme n item category all;;coats jackets;;womens coats n index 1 n n n n n curlopt httpheader array n content type application json n n ; n n response curl exec curl ; n ncurl close curl ; necho response; n language php customlabel id edjoaar2zbyzaldipyefn code var data json stringify event view recs list event apikey klevu 12345 event list id 12345 abcde event tags recspagetype category event list name new arrivals event list logic newest arrivals user profile ip address 111 11 11 1 items item id 12345 54321 item group id 12345 item variant id 54321 item name hoodie sweatshirt price 123 45 currency gbp item brand acme item category all;;coats jackets;;womens coats index 1 event select recs list event apikey klevu 12345 event list id 12345 abcde event tags recspagetype category event list name new arrivals event list logic newest arrivals items item id 12345 54321 item group id 12345 item variant id 54321 item name hoodie sweatshirt price 123 45 currency gbp item brand acme item category all;;coats jackets;;womens coats index 1 ; n nvar xhr new xmlhttprequest ; nxhr withcredentials false; n nxhr addeventlistener readystatechange function n if this readystate 4 n console log this responsetext ; n n ; n nxhr open post https stats ksearchnet com analytics collect ; nxhr setrequestheader content type application json ; n nxhr send data ; language javascript customlabel id zzumafhlxj 2brmng3ssl code okhttpclient client new okhttpclient newbuilder n build ; nmediatype mediatype mediatype parse application json ; nrequestbody body requestbody create mediatype n n event view recs list n event apikey klevu 12345 n event list id 12345 abcde n event tags n recspagetype category n n event list name new arrivals n event list logic newest arrivals n user profile ip address 111 11 11 1 n items n n item id 12345 54321 n item group id 12345 n item variant id 54321 n item name hoodie sweatshirt n price 123 45 n currency gbp n item brand acme n item category all;;coats jackets;;womens coats n index 1 n n n n n event select recs list n event apikey klevu 12345 n event list id 12345 abcde n event tags n recspagetype category n n event list name new arrivals n event list logic newest arrivals n items n n item id 12345 54321 n item group id 12345 n item variant id 54321 n item name hoodie sweatshirt n price 123 45 n currency gbp n item brand acme n item category all;;coats jackets;;womens coats n index 1 n n n n ; nrequest request new request builder n url https stats ksearchnet com analytics collect n method post body n addheader content type application json n build ; nresponse response client newcall request execute ; language java customlabel id d8ae l0vu6r3vbktka0iz code var request require request ; nvar options n method post n url https stats ksearchnet com analytics collect n headers n content type application json n n body json stringify event view recs list event apikey klevu 12345 event list id 12345 abcde event tags recspagetype category event list name new arrivals event list logic newest arrivals user profile ip address 111 11 11 1 items item id 12345 54321 item group id 12345 item variant id 54321 item name hoodie sweatshirt price 123 45 currency gbp item brand acme item category all;;coats jackets;;womens coats index 1 event select recs list event apikey klevu 12345 event list id 12345 abcde event tags recspagetype category event list name new arrivals event list logic newest arrivals items item id 12345 54321 item group id 12345 item variant id 54321 item name hoodie sweatshirt price 123 45 currency gbp item brand acme item category all;;coats jackets;;womens coats index 1 n n ; nrequest options function error response n if error throw new error error ; n console log response body ; n ; n language nodejs customlabel selectedlanguageid edjoaar2zbyzaldipyefn description the end point is used for reporting banner product views currentnewparameter label body parameter value bodydataparameters tab examples url https analytics url analytics collect name reporting banner product clicks method post request pathparameters queryparameters headerparameters bodydataparameters kind required name event type string description please use select recs list kind required name event apikey t type string description your klevu js api key eg klevu 12345 kind required name event list id type string description the unique identifier for your kmc recommendations banner eg 12345 abcde this is available in the banner configuration metadata as recskey if you are not using banners configured within the kmc please specify a unique identifier for the banner which will be used to distinguish one banner from another kind required name event list name type string description the name of the banner eg new arrivals this is available in the banner configuration metadata as title kind required name event list logic type string description the logic type of the banner eg newest arrivals this is available in the banner configuration metadata as logic kind optional name event tags type array description this can be used to specify additional information about the event which will eventually be made available within the kmc we recommend you specify the type of page eg home this is available in the banner configuration metadata as pagetype name user profile kind required type object description the json object that holds the user related information such as ip address children name ip address kind required type string description ip address of the shopper who purchased the product n n if calling from javascript this is an optional parameter name ip address v4 kind optional type string description ipv4 address of the shopper who viewed a product name ip address v6 kind optional type string description ipv6 address of the shopper who viewed a product name data protection kind optional type boolean description if set to false klevu s backend do not obtain the shoppers ip address the default value is true name klevu uuid kind optional type string description universally unique identifier generated by klevu it can be also considered as session id please obtain uuid using end point https docs klevu com apis uuid name klevu country kind optional type string description 2 digit country code of the shopper who viewed a product valid codes can be found at https developers google com hotels hotel prices dev guide country codes name klevu city kind optional type string description city name of the shopper who viewed a product kind required name items type array description provide specific information about the one product which was clicked within your banner kind required name item id type string description the full id of the product eg 12345 54321 this will match the unique value used in your data sync process with klevu for compound products consisting of a child variant and a parent this is usually parentid childid kind required name item group id type string description the parent id of the product eg 12345 for compound products consisting of a child variant and a parent please specify the id of the parent for simple products please re use the same value as item id kind required name item variant id type string description the child id of the product eg 54321 please specify the id of the child variant product for simple products please re use the same value as item id kind required name item name type string description the name of the product kind required name price type number description the final selling price of the product for example 123 45 kind optional name currency type string description the currency of the above price eg usd kind optional name item brand type string description the brand of the product for example nike or acme kind optional name item category type string description the category the item belongs to for nested categories use the ; character to separate the hierarchy and for multiple categories use a double ;; for example for mens shoes trainers and sale you would specify mens;shoes;trainers;;sale kind required name index type integer description the order of the product in the listing starting from 1 formdataparameters results languages id fi7dvhqck3 p270nihihk code language 200 customlabel selectedlanguageid fi7dvhqck3 p270nihihk examples languages id djsrpqrxfqsrjfnj4p wd code ?php n n curl curl init ; n ncurl setopt array curl array n curlopt url https stats ksearchnet com analytics collect 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 post n curlopt postfields n n event view recs list n event apikey klevu 12345 n event list id 12345 abcde n event tags n recspagetype category n n event list name new arrivals n event list logic newest arrivals n user profile n ip address 111 11 11 1 n n items n n item id 12345 54321 n item group id 12345 n item variant id 54321 n item name hoodie sweatshirt n price 123 45 n currency gbp n item brand acme n item category all;;coats jackets;;womens coats n index 1 n n n n n event select recs list n event apikey klevu 12345 n event list id 12345 abcde n event tags n recspagetype category n n event list name new arrivals n event list logic newest arrivals n user profile n ip address 111 11 11 1 n n items n n item id 12345 54321 n item group id 12345 n item variant id 54321 n item name hoodie sweatshirt n price 123 45 n currency gbp n item brand acme n item category all;;coats jackets;;womens coats n index 1 n n n n n curlopt httpheader array n content type application json n n ; n n response curl exec curl ; n ncurl close curl ; necho response; n language php customlabel id edjoaar2zbyzaldipyefn code var data json stringify event view recs list event apikey klevu 12345 event list id 12345 abcde event tags recspagetype category event list name new arrivals event list logic newest arrivals user profile ip address 111 11 11 1 items item id 12345 54321 item group id 12345 item variant id 54321 item name hoodie sweatshirt price 123 45 currency gbp item brand acme item category all;;coats jackets;;womens coats index 1 event select recs list event apikey klevu 12345 event list id 12345 abcde event tags recspagetype category event list name new arrivals event list logic newest arrivals items item id 12345 54321 item group id 12345 item variant id 54321 item name hoodie sweatshirt price 123 45 currency gbp item brand acme item category all;;coats jackets;;womens coats index 1 ; n nvar xhr new xmlhttprequest ; nxhr withcredentials false; n nxhr addeventlistener readystatechange function n if this readystate 4 n console log this responsetext ; n n ; n nxhr open post https stats ksearchnet com analytics collect ; nxhr setrequestheader content type application json ; n nxhr send data ; language javascript customlabel id zzumafhlxj 2brmng3ssl code okhttpclient client new okhttpclient newbuilder n build ; nmediatype mediatype mediatype parse application json ; nrequestbody body requestbody create mediatype n n event view recs list n event apikey klevu 12345 n event list id 12345 abcde n event tags n recspagetype category n n event list name new arrivals n event list logic newest arrivals n user profile ip address 111 11 11 1 n items n n item id 12345 54321 n item group id 12345 n item variant id 54321 n item name hoodie sweatshirt n price 123 45 n currency gbp n item brand acme n item category all;;coats jackets;;womens coats n index 1 n n n n n event select recs list n event apikey klevu 12345 n event list id 12345 abcde n event tags n recspagetype category n n event list name new arrivals n event list logic newest arrivals n items n n item id 12345 54321 n item group id 12345 n item variant id 54321 n item name hoodie sweatshirt n price 123 45 n currency gbp n item brand acme n item category all;;coats jackets;;womens coats n index 1 n n n n ; nrequest request new request builder n url https stats ksearchnet com analytics collect n method post body n addheader content type application json n build ; nresponse response client newcall request execute ; language java customlabel id d8ae l0vu6r3vbktka0iz code var request require request ; nvar options n method post n url https stats ksearchnet com analytics collect n headers n content type application json n n body json stringify event view recs list event apikey klevu 12345 event list id 12345 abcde event tags recspagetype category event list name new arrivals event list logic newest arrivals user profile ip address 111 11 11 1 items item id 12345 54321 item group id 12345 item variant id 54321 item name hoodie sweatshirt price 123 45 currency gbp item brand acme item category all;;coats jackets;;womens coats index 1 event select recs list event apikey klevu 12345 event list id 12345 abcde event tags recspagetype category event list name new arrivals event list logic newest arrivals items item id 12345 54321 item group id 12345 item variant id 54321 item name hoodie sweatshirt price 123 45 currency gbp item brand acme item category all;;coats jackets;;womens coats index 1 n n ; nrequest options function error response n if error throw new error error ; n console log response body ; n ; n language nodejs customlabel selectedlanguageid zzumafhlxj 2brmng3ssl description the end point is used for reporting banner product clicks currentnewparameter label body parameter value bodydataparameters