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
String
required
This is your Klevu JS API Key.
klevu_term
String
required
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
String
required
This is the total number of results returned for the searched term. It must be an integer (e.g. 5)
klevu_typeOfQuery
String
required
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
String
required
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
String
optional
IPv4 address of the shopper who searched a term.
klevu_shopperIP_v6
String
optional
IPv6 address of the shopper who searched a term.
data_protection
Boolean
optional
If set to false, Klevu's backend do not obtain the shoppers' IP address. The default value is true.
klevu_uuid
String
optional
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
String
optional
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
String
optional
City name of the shopper who searched a term.
Use this API endpoint to submit the product clicks from search results.
GET
Request
Query Parameters
klevu_apiKey
String
required
This is your Klevu JS API Key.
klevu_keywords
String
required
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
String
required
This is constant value. The value must be clicked.
klevu_productId
String
required
This is the Klevu ID of the clicked product. eg. 54321-12345.
klevu_productGroupId
String
required
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
String
required
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
String
required
This is the product name of the clicked product.
klevu_productUrl
String
required
This is the product URL of the clicked product.
klevu_shopperIP
String
required
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
String
optional
IPv4 address of the shopper who clicked a product.
klevu_shopperIP_v6
String
optional
IPv6 address of the shopper who clicked a product.
data_protection
Boolean
optional
If set to false, Klevu's backend do not obtain the shoppers' IP address. The default value is true.
klevu_uuid
String
optional
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
String
optional
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
String
optional
City name of the shopper who clicked a product.
Updated 13 Aug 2024

Did this page help you?