Product Filtering

If your e-commerce site supports filtering that uses the and/or functionality, CitrusAd can support this with additional parameters in your request. This accommodates to e-commerce sites that allow users to select brands to filter by brand, categories, and more.

There are two types of filtering

andOr Filtering (Recommended)

andOr filtering is useful for contexts where the user has filtered deep in their search. It allows simpler context formatting whilst supporting deep filtering. The method follows the below structure:

"productFilters": [
[ "" OR "" ] AND [ "" OR "" ] AND [ "" OR "" ]
],
"options": {
"filterMode": "AndOr"
},

In the request, you will need to specify:

"options": {
"filterMode": "AndOr"
},

You must specify the filterMode of andOr for this functionality to behave correctly

This will enable you to request multiple product filter arrays like below:

"productFilters": [
["category:bread"],
["brand:brandA","brand:brandB"],
["price:below $10"],
["nutrition:organic","nutrition:vegan"]
],

This context would support a page wherein the user has navigated to the bread category, and filtered by brandA and brandB, pricing below $10, as well as nutrition specifications of organic and vegan

The context explained:

"productFilters": [
["category:bread"], AND
["brand:brandA", OR "brand:brandB"], AND
["price:below $10"], AND
["nutrition:organic", OR "nutrition:vegan"]
],

orAnd Filtering (Default Mode)

The default method of filtering product filters follows the below structure

"productFilters": [
[ "" AND "" ], OR [ "" AND "" ], OR [ "" AND "" ]
],

An example of this would be:

"productFilters": [
["category:smartphones", "brandName:brandA" ],
["category:smartphones", "brandName:brandB"]
],

This context would support a page wherein the user has navigated to the smartphones category, and filtered by brandA and brandB.

The context explained:

"productFilters": [
["category:smartphones", AND "brandName:brandA" ], OR
["category:smartphones", AND "brandName:brandB"]
],

You do not need to specify a filterMode of orAnd for this functionality as it is the default behaviour