Guide
Smart Search
Analytics Events
2min
Use this API endpoint to submit the search activities.
GET
Params
Query Parameters
klevu_apiKey
required
String
This is your Klevu JS API Key.
klevu_term
required
String
This is the term being searched. For example iphone 5s.
klevu_totalResults
required
String
This is the total number of results returned for the searched term. It must be an integer (e.g. 5)
klevu_typeOfQuery
required
String
When you receive a response for a search query, look at the value of the typeOfQuery element under the metaData section (e.g. WILDCARD_AND, FUZZY_AND). You need to pass this value to this parameter.
klevu_shopperIP
optional
String
IP address of the shopper who searched a term. If calling from javascript (i.e. an ajax call), this is an optional parameter.
Use this API endpoint to submit the product clicks from search results.
GET
Params
Query Parameters
klevu_apiKey
required
String
This is your Klevu JS API Key.
klevu_keywords
required
String
This is the term being searched. For example iphone 5s.
klevu_type
required
String
This is constant value. The value must be clicked.
klevu_productId
required
String
This is the Klevu ID of the clicked product. eg. 54321-12345.
klevu_productGroupId
required
String
This is the parent ID of the clicked product. eg. 54321. For compound products with a parent and multiple child/variant products, this is the common ID which ties the products together. For simple products, please specify the same as klevu_productId.
klevu_productVariantId
required
String
This is the child/variant ID of the clicked product. eg. 12345. For compound products with a parent and multiple child/variant products, this is the ID of the specific variant. For simple products, please specify the same as klevu_productId.
klevu_productName
required
String
This is the product name of the clicked product.
klevu_productUrl
required
String
This is the product URL of the clicked product.
klevu_shopperIP
optional
String
IP address of the shopper who clicked on a product. If calling from javascript (i.e. an ajax call), this is an optional parameter.
Use this API endpoint to submit the order data.
GET
Params
Query Parameters
klevu_apiKey
required
String
This is your Klevu JS API Key.
klevu_type
required
String
This is constant value. The value must be checkout.
klevu_productId
required
String
This is the Klevu ID of the clicked product. eg. 54321-12345.
klevu_productGroupId
required
String
This is the parent ID of the clicked product. eg. 54321. For compound products with a parent and multiple child/variant products, this is the common ID which ties the products together. For simple products, please specify the same as klevu_productId.
klevu_productVariantId
required
String
This is the child/variant ID of the clicked product. eg. 12345. For compound products with a parent and multiple child/variant products, this is the ID of the specific variant. For simple products, please specify the same as klevu_productId.
klevu_unit
required
Integer
This is the total quantity purchased. It must be an integer (e.g. 5).
klevu_salePrice
required
Number
Product's sale price for one unit. You can supply decimal values.
klevu_currency
required
String
Three digit currency code. e.g GBP, USD, EUR.
klevu_shopperIP
optional
String
IP address of the shopper who bought the product(s). If calling the checkout HTTP call from javascript, this is an optional parameter.
The end-point is used for reporting multiple orders.
POST
Params
Body Parameters
event_version
required
String
The event version is used by Klevu's backend. The current version is 1.0.0
event
required
String
Define the type of event. For order, use a constant value order_purchase.
event_apikey
required
String
Your Klevu JS Api Key, eg. klevu-12345.
user_profile
optional
Object
The optional json object that holds the user related information such as ip_address, email.
items
required
Array
Depending on the number of orders, the item array accepts single or more orders.
order_id
optional
String
The unique identifier for your orders.
order_line_id
optional
String
The unique identifier for reference to a line on an order within the database.
item_name
required
String
The name of the product.
item_id
required
String
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.
item_group_id
required
String
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
item_variant_id
required
String
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.
unit_price
required
Number
The final selling price of the product, for example 123.45
currency
required
String
The currency of the above price, eg. USD.
units
optional
Integer
The number of units sold for a product. In case if the parameter is mising, the default value will be 1
Updated 25 Mar 2024
Did this page help you?