Guide
Analytics Tracking
Category Events
2min
Use this API endpoint to submit category page views activity:
1. When the category 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_categoryName
required
String
This is the name of the category being visited. For example, Stackable Rings. The name should not include parent categories.
klevu_categoryPath
required
String
This is the complete hierarchy of the category being visited. For example, Jewellery;Rings;Stackable Rings. Please note the use of a semicolon as the separator between a parent and a child category.
klevu_productIds
required
String
Comma separated list of product IDs being shown on the current page of the category page. For example, P1,P2,P3,P4,P5…
All the product IDs listed here are treated as impressions for these products.
klevu_pageStartsFrom
optional
String
Offset of the first product being shown on this page. For example, if you are displaying 30 products per page and if a customer is on the 2nd page, the value here should be 30. If on the 3rd page, it will be 60.
klevu_shopperIP
required
String
IP address of the shopper who viewed the category page.
*If calling from javascript, this is an optional parameter.
klevu_activeFilters
optional
String
This refers to the filters that were applied during the category page view event. The format for the applied filters is "<filterKey1>:<filterValue1>;;<filterKey2>:<filterValue2>". Multiple filters are separated by ";;". For example, "style:Underseat Luggage;;color:blue".
klevu_abTestId
optional
String
The unique identifier of the A/B Test.
klevu_abTestVariantId
optional
String
The unique identifier of the A/B Test Variant.
klevu_shopperIP_v4
optional
String
IPv4 address of the shopper who viewed a category page.
klevu_shopperIP_v6
optional
String
IPv6 address of the shopper who viewed a category page.
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 viewed a category. 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 viewed a category.
Use this API endpoint to submit the product clicks from category page results.
GET
Request
Query Parameters
klevu_apiKey
required
String
This is your Klevu JS API Key.
klevu_categoryName
required
String
This is the name of the category being visited. For example, Stackable Rings. The name should not include parent categories.
klevu_categoryPath
required
String
This is the complete hierarchy of the category being visited. For example, Jewellery;Rings;Stackable Rings. Please note the use of a semicolon as the separator between a parent and a child category.
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
optional
String
Name of the product that was clicked.
klevu_productUrl
optional
String
URL of the product that was clicked.
klevu_productSku
optional
String
SKU code of the product that was clicked.
klevu_salePrice
optional
String
Decimal sale price of the product that was clicked.
klevu_productRatings
optional
Number
A decimal rating value between 0 and 5 of the product that was clicked.
klevu_productPosition
optional
Integer
Position of the product on the category page when it was clicked. For example, the value would be 0 if it is the first product on the first page. The value will be 30, if it is the first product on the 2nd page with 30 products being displayed per page.
klevu_shopperIP
required
String
IP address of the shopper who clicked the product(s).
*If calling from javascript, this is an optional parameter.
klevu_activeFilters
optional
String
This refers to the filters that were applied during the product clicked event. The format for the applied filters is "<filterKey1>:<filterValue1>;;<filterKey2>:<filterValue2>". Multiple filters are separated by ";;". For example, "style:Underseat Luggage;;color:blue".
klevu_abTestId
optional
String
The unique identifier of the A/B Test.
klevu_abTestVariantId
optional
String
The unique identifier of the A/B Test Variant.
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.
Use this API endpoint to report which A/B test variant is viewed.
POST
Request
Query Parameters
sourceId
required
String
The unique identifier of the element to which the A/B Test ID and Variant are assigned to. In this case, it will be a Category name.
abTestId
required
String
The unique identifier of the A/B Test.
abTestVariantId
required
String
The unique identifier of the A/B Test Variant.
type
required
String
The type of element to which an A/B Test will be assigned. For now, will be “CAT_NAV”.
Updated 13 Aug 2024
Did this page help you?