Skip to content

How-To: Merchandise on a Specific Category ​

Some use cases require you to be able to target a merchandising rule toward a specific Product Listing Page, without affecting the rest of your site. Normally, this can be accomplished with the use of a distinct Display Location, but in the event that you either cannot or will not add a new Display Location, it is possible to specify the target of the rule to be only a specific Product Category. This is done by targeting the Product Category ID filter in the API request itself.

DEPENDENCIES

This method requires PLPs built with Relewise Search using a termless search and a Product Category ID filter. It applies when that request generates the PLP results.

This guide is not concerned with what your Merchandising rule is supposed to do, and only concerns itself with how you target a specific Product Category. This method is applicable to all types of merchandising rule.

To set this up, you will need one of the following set up ahead of time:

  • Your PLPs are created with the Relewise Search
  • Having user tracking set up is not required, but will make your work much easier

Request Filter vs. Display Location

A condition in Request Filters must match the incoming request filter exactly, including the Product Category ID and Category Scope (the filter's EvaluationScope). A filter that names a different Product Category does not match the same condition.

If you have multiple Product Categories that should all be affected at the same time, we strongly urge you to implement a distinct Display Location instead.

Merchandising on a Specific Product Category ID ​

To apply a merchandising rule only to a specific Product Category, use Request Conditions > Request Filters. The API request must contain a filter that matches the condition exactly, including its Product Category ID and Category Scope (EvaluationScope in the API filter).

Request Filters with controls for including and excluding filters supplied in the request

In order to ensure that you are matching the incoming request's filter exactly, the easiest way is to capture it from the Search Overview page.

Retrieve your User ID ​

  1. In one browser window, open the My Relewise Search Overview page
  2. In a second browser window, open your website
  3. Now we want to find your User ID. Enter a search into your website's search bar, and immediately refresh the My Relewise Search Overview page. You should be able to find your search without too many issues - for ease of use, try entering something distinct, like a string of nonsense characters, e.g., "qweqweqwe"

Use the Search Overview page to find your User ID

Searching for a distinct string makes it easier to identify your own user among the rest.

You are looking for the information contained in the User field - copy this and keep it handy (Hint: You can click on the User ID to open up a User Entity modal, and copy the ID directly from there):

Copy the User ID from the User Modal

Grab the User ID directly from the User entity modal

 

No User ID

If your solution does not allow you to grab a User ID for whatever reason, you can still follow the rest of the steps in this guide - you just have to manually figure out which of the requests in the Overview page is the one you have prompted. There is no shortcut to this without the User ID available - look at the product results on the overview page, and compare them with the products being shown on your product category page. If they are the same, you have found your request.

Retrieve your API Request ​

Now you need to isolate the API request being generated when you load your PLP page.

  1. On your website, navigate to the category page you want to affect, and keep the page open.
  2. In My Relewise, apply the User ID you retrieved above to the "Search" field, to only filter on your own requests

Filter the search requests by your User ID

Filter by your User ID

 

  1. Refresh the category page on your website, and immediately refresh the Search Overview page. This should allow you to capture the PLP generation request (if it doesn't work after a few attempts, odds are you are not creating PLPs with Relewise - in which case this method will not work for you)
  2. With your request in hand, click the "Details" icon on the far right to open the raw JSON of the request

Click the Details icon to retrieve the raw JSON

Click the 'details' button to view the raw JSON of the request

Identify the Filter ​

You are now ready to retrieve the filter information for the PLP you want to merchandise on. Keep in mind that requests can differ in length and complexity, so this may be a bit complex. Do not lose hope, however; it is not as intimidating as it looks.

  1. With the Request Details open, scroll down (or perform a page search) to find the start of the "Filters" segment
  2. You will likely have more than one filter on your request, so look for where it says ProductCategoryIdFilter. Alternatively, you can perform a page search directly for it:

Locate the Product Category ID filter details in the request

You will need the details of the request going forward - keep it open.

Create the Merchandising Rule ​

With the filter identified, keep it open and navigate to Merchandising in My Relewise. Create your rule, then open Request Conditions > Request Filters and select Add Filter under Include Filters. The filter must match the incoming request exactly, including its Category Scope. See Request Conditions for how conditions and scope combine.

You need to make sure that the rule matches the filter exactly. Follow these steps:

  1. Choose Matches Category IDs under Product Categories
  2. Copy the Product Category ID from the filter into the rule
    • While it is technically possible to simply retrieve the Product Category ID directly from the Product Categories Entities page, the fact that you will need to match the entire filter exactly means that you will save yourself a lot of work by just grabbing the request and using what's in it.
  3. Under "Category Scope", make sure that you match the value found in the filter, under EvaluationScope:

Category Scope in My Relewise must match the API filter EvaluationScope

Category Scope must match the API filter's EvaluationScope exactly.

Finalize the Merchandising Rule ​

With the Product Category ID and Category Scope defined, the condition matches only requests containing that exact filter. Configure the rule's target entities and action, then save the rule.

Don't know us? Don't worry - you can find more information about us, by visiting our main page www.relewise.com