Guide
Analytics Tracking

Search Events

1min



Use this API endpoint to submit the search activities: 1. When the search response is received 2. And also when a facet is clicked (triggering a follow up query)
GET
Request
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. *For tracking of a facet click, append the selected facet to the term. e.g iphone 5s [[color:black]]
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
required
String
IP address of the shopper who searched a term. *If calling from javascript (i.e. an ajax call), this is an optional parameter.
klevu_shopperIP_v4
optional
String
IPv4 address of the shopper who searched a term.
klevu_shopperIP_v6
optional
String
IPv6 address of the shopper who searched a term.
data_protection
optional
Boolean
If set to false, Klevu's backend do not obtain the shoppers' IP address. The default value is true.
klevu_uuid
optional
String
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
klevu_country
optional
String
2-digit country code of the shopper who searched a term. Valid codes can be found at https://developers.google.com/hotels/hotel-prices/dev-guide/country-codes
klevu_city
optional
String
City name of the shopper who searched a term.
Curl
Node.js
JS
Python
Ruby
Responses
200




Use this API endpoint to submit the product clicks from search results.
GET
Request
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. *For tracking of a facet click, append the selected facet to the term. e.g iphone 5s [[color:black]]
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
required
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.
klevu_shopperIP_v4
optional
String
IPv4 address of the shopper who clicked a product.
klevu_shopperIP_v6
optional
String
IPv6 address of the shopper who clicked a product.
data_protection
optional
Boolean
If set to false, Klevu's backend do not obtain the shoppers' IP address. The default value is true.
klevu_uuid
optional
String
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
klevu_country
optional
String
2-digit country code of the shopper who searched a term. Valid codes can be found at https://developers.google.com/hotels/hotel-prices/dev-guide/country-codes
klevu_city
optional
String
City name of the shopper who clicked a product.
Curl
Node.js
JS
Python
Ruby
Responses
200