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
String
required
This is your Klevu JS API Key.
klevu_categoryName
String
required
This is the name of the category being visited. For example, Stackable Rings. The name should not include parent categories.
klevu_categoryPath
String
required
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
String
required
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
String
optional
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
String
required
IP address of the shopper who viewed the category page.
*If calling from javascript, this is an optional parameter.
klevu_activeFilters
String
optional
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
String
optional
The unique identifier of the A/B Test.
klevu_abTestVariantId
String
optional
The unique identifier of the A/B Test Variant.
klevu_shopperIP_v4
String
optional
IPv4 address of the shopper who viewed a category page.
klevu_shopperIP_v6
String
optional
IPv6 address of the shopper who viewed a category page.
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 viewed a category. 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 viewed a category.
Use this API endpoint to submit the product clicks from category page results.
GET
Request
Query Parameters
klevu_apiKey
String
required
This is your Klevu JS API Key.
klevu_categoryName
String
required
This is the name of the category being visited. For example, Stackable Rings. The name should not include parent categories.
klevu_categoryPath
String
required
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
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
optional
Name of the product that was clicked.
klevu_productUrl
String
optional
URL of the product that was clicked.
klevu_productSku
String
optional
SKU code of the product that was clicked.
klevu_salePrice
String
optional
Decimal sale price of the product that was clicked.
klevu_productRatings
Number
optional
A decimal rating value between 0 and 5 of the product that was clicked.
klevu_productPosition
Integer
optional
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
String
required
IP address of the shopper who clicked the product(s).
*If calling from javascript, this is an optional parameter.
klevu_activeFilters
String
optional
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
String
optional
The unique identifier of the A/B Test.
klevu_abTestVariantId
String
optional
The unique identifier of the A/B Test Variant.
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.
Use this API endpoint to report which A/B test variant is viewed.
POST
Request
Query Parameters
sourceId
String
required
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
String
required
The unique identifier of the A/B Test.
abTestVariantId
String
required
The unique identifier of the A/B Test Variant.
type
String
required
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?