Classes
Class: KlevuEvents
28min
@klevu/core / @klevu/core docid 7vdpes 8 0tv 43dya7ly / klevuevents table of contents constructors class klevuevents docid\ v4s0tebonpr8hwup9x7dw methods class klevuevents docid\ v4s0tebonpr8hwup9x7dwclass klevuevents docid\ v4s0tebonpr8hwup9x7dwclass klevuevents docid\ v4s0tebonpr8hwup9x7dwclass klevuevents docid\ v4s0tebonpr8hwup9x7dwclass klevuevents docid\ v4s0tebonpr8hwup9x7dwclass klevuevents docid\ v4s0tebonpr8hwup9x7dwclass klevuevents docid\ v4s0tebonpr8hwup9x7dwclass klevuevents docid\ v4s0tebonpr8hwup9x7dw constructors constructor • new klevuevents () methods buy ▸ static buy ( items ) void tell klevu what products where bought by the user parameters name type description items object items user bought items items { amount number ; orderid? string ; orderlineid? string ; override? partial <{ currency string ; item group id string ; item id string ; item name string ; item variant id string ; order id? string ; order line id? string ; unit price number ; units? number }> ; product pick < @klevu/core docid 7vdpes 8 0tv 43dya7ly , "id" > & partial < pick < @klevu/core docid 7vdpes 8 0tv 43dya7ly , "name" | "currency" | "itemgroupid" | "saleprice" >> ; variantid? string }\[] items user? object items user email? string items user ip address? string returns void defined in events/klevuevents ts 44 https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/events/klevuevents ts#l44 categorymerchandisingproductclick ▸ static categorymerchandisingproductclick ( «destructured» ) void parameters name type «destructured» object › abtestid? string › abtestvariantid? string › activefilters? string › categorytitle string › klevucategory string › override? partial < klevuv1categoryproductsclick > › product pick < @klevu/core docid 7vdpes 8 0tv 43dya7ly , "id" > & partial < pick < @klevu/core docid 7vdpes 8 0tv 43dya7ly , "name" | "itemgroupid" | "saleprice" | "sku" | "url" >> › productposition? number › variantid? string returns void defined in events/klevuevents ts 368 https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/events/klevuevents ts#l368 categorymerchandisingview ▸ static categorymerchandisingview ( «destructured» ) void parameters name type «destructured» object › abtestid? string › abtestvariantid? string › activefilters? string › categorytitle string › klevucategory string › override? partial < klevuv1categoryproductsview > › pagestartsfrom? number › products pick < @klevu/core docid 7vdpes 8 0tv 43dya7ly , "id" >\[] returns void defined in events/klevuevents ts 323 https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/events/klevuevents ts#l323 imagebannerclick ▸ static imagebannerclick ( «destructured» ) void when user clicks on the banner that is in quicksearch or on search landing page parameters name type description «destructured» object › bannerid string id of the banner › bannername string name of the banner › imageurl string url of the image › override partial < klevuv1imagebannerclick > › targeturl string url where the user is redirected › term string search term used to get the results returns void defined in events/klevuevents ts 423 https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/events/klevuevents ts#l423 recommendationclick ▸ static recommendationclick ( «destructured» ) void when product has been clicked in the recommendation banner parameters name type description «destructured» object › bannerinfo? klevueventv2datastaticcontent › override? partial < klevurecommendationseventv2data > › product? pick < @klevu/core docid 7vdpes 8 0tv 43dya7ly , "id" > & partial < pick < @klevu/core docid 7vdpes 8 0tv 43dya7ly , "name" | "brand" | "category" | "currency" | "itemgroupid" | "saleprice" >> › productindexinlist? number › recommendationmetadata object › recommendationmetadata action? null | "static content" | "hide recommendation" | "filter" special cases of recommendation › recommendationmetadata enabled boolean › recommendationmetadata logic enumeration kmcrecommendationlogic docid\ z3h8lsdvbcgyast03bdbe logic used in recommendation › recommendationmetadata maxproducts number amount of products to fetch › recommendationmetadata pagetype kmcrecommendationpagetype target page type of recommendation › recommendationmetadata productthreshold number › recommendationmetadata recskey string id of the recommendation › recommendationmetadata segmentkey null | string user segment key › recommendationmetadata segmentname null | string user segment name › recommendationmetadata spotkey string id of the spot › recommendationmetadata spotname string spot name › recommendationmetadata title string title of the recommendation › variantid? string returns void defined in events/klevuevents ts 170 https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/events/klevuevents ts#l170 recommendationview ▸ static recommendationview ( «destructured» ) void when recommendation banner is shown in the page parameters name type «destructured» object › override? partial < klevurecommendationseventv2data > › products? pick < @klevu/core docid 7vdpes 8 0tv 43dya7ly , "id" > & partial < pick < @klevu/core docid 7vdpes 8 0tv 43dya7ly , "name" | "brand" | "category" | "currency" | "itemgroupid" | "price" | "variantid" >>\[] › recommendationmetadata partial <{ action? null | "static content" | "hide recommendation" | "filter" ; enabled boolean ; logic enumeration kmcrecommendationlogic docid\ z3h8lsdvbcgyast03bdbe ; maxproducts number ; pagetype kmcrecommendationpagetype ; productthreshold number ; recskey string ; segmentkey null | string ; segmentname null | string ; spotkey string ; spotname string ; title string }> & pick <{ action? null | "static content" | "hide recommendation" | "filter" ; enabled boolean ; logic enumeration kmcrecommendationlogic docid\ z3h8lsdvbcgyast03bdbe ; maxproducts number ; pagetype kmcrecommendationpagetype ; productthreshold number ; recskey string ; segmentkey null | string ; segmentname null | string ; spotkey string ; spotname string ; title string }, "logic" | "recskey" | "title" > returns void defined in events/klevuevents ts 97 https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/events/klevuevents ts#l97 search ▸ static search ( «destructured» ) void what user has last searched this is important for klevu to function properly use sendsearchevent() modifier with search query to send results parameters name type «destructured» object › activefilters? string › override? partial < v1searchevent > › term string › totalresults number › typeofsearch enumeration klevutypeofsearch docid 3fsfdwgnkdoxmw8q6aiu3 returns void defined in events/klevuevents ts 284 https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/events/klevuevents ts#l284 searchproductclick ▸ static searchproductclick ( «destructured» ) void when product is clicked do not use this for recommendations parameters name type «destructured» object › activefilters? string › override? partial < v1producttrackingevent > › product pick < @klevu/core docid 7vdpes 8 0tv 43dya7ly , "id" > & partial < pick < @klevu/core docid 7vdpes 8 0tv 43dya7ly , "name" | "itemgroupid" | "url" >> › searchterm? string › variantid? string returns void defined in events/klevuevents ts 240 https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/events/klevuevents ts#l240