Guide
Smart Category Merchandising

A/B Test

5min

If you haven't gone through the prerequisites and the v2 structure, please have a look at Overview

Klevu can also power your category pages using A/B Testing. This means that for a given Test and Variant combination, the products for a given category are retrieved using the Visual Merchandising rules configured for that A/B Test and Variant.

Allocating Variants to Store Categories

Klevu allocates for each Category, an A/B Test and a Variant with their IDs. For Category Merchandising, the type will always be “CAT_NAV”.

Our recommendation is that this request be polled at an interval between 20 minutes and 1 hour, to get either new allocations or skewed allocations of Variants to Categories that were not yet clicked by a shop customer.

As long as an A/B Test ID is received as a Response on this call, said A/B Test is considered Active. Once an ID is no longer received in the Response of this call, it should be removed from the local browser storage.

For each assignment, the distribution of Variants can be different for the same A/B Test ID and Categories. If a Category with an A/B Test Variant ID is selected and viewed by a Shop Customer, that state of having been visited should be recorded, and once another Variant ID is received on the Response for a visited Category, it should be ignored. If a Variant ID is received for a Category that has not yet been visited by a Shop Customer, that Variant ID can be assigned to the Category and it can overwrite any already-existing values in the local browser storage.

The end-point is used to reteriving available A/B test variants.
POST
Request
PHP
Java
Curl
Node.js
JS
Responses
200


Category Product Search with A/B Test

This is an example how to fetch products from specific A/B test variant. Note: {{Your APIv2 URL}} can be found in your KMC under 'Store Settings'
POST
Request
Body Parameters
typeOfRequest
required
String
This parameter defines the type of request it is, which should be 'CATNAV' for category merchandising queries. There are other values available, detailed elsewhere in the documentation.
categoryPath
required
String
Specify the name of the category to retrieve results from, in the same case and format as it is indexed with Klevu. For nested categories, use the ; character to separate the hierarchy. For example, for 'Mens > Shoes > Trainers and Sneakers' you would specify: Mens;Shoes;Trainers and Sneakers.
abTestId
required
String
The unique identifier of the A/B Test.
abTestVariantId
required
String
The unique identifier of the A/B Test Variant.
Request Body (JSON)
PHP
JS
Java
Node.js
Responses
200


Try it here!