Skip to main content

User Segment Rules

User segment rules are a powerful tool to adjust result ranking for classes of queries. The concept operates on tags assigned to users' requests at query time.

Example use cases include:

  • Adjusting result ranking for users in a particular a/b test segment.
  • Boosting a particular brand for users with an affinity for it (such as identified by an outside data or loyalty platform).
  • Boosting ice cream for requests happening at night.

Tagging requests

Currently user segments are applied by passing a value in with the us query parameter (user segment). In the future automatically generated user segments will be exposed in this endpoint, so that rules can be generated based on location, time-of-day and other parameters. The goal is to give customer teams similar optimization abilities as applied automatically by Constructor.

You can pass custom user segments to search or behavioral tracking endpoints using the us argument like so: &us=segment1. This then gives one the ability to define behavior on the basis of tag_name user_segment and tag_value segment1.

Types of rules

Note that user segment rules only support boost and bury rules for the time being to increase or decrease ranking of products matching a given condition for requests with the given tag.

Slotting, blacklisting and whitelisting rule types are not yet supported.

Rule limits

A maximum of 50 boost rules may be applied to a given key-value pair - in the above case, the user_segment:segment1 pair.

Applying rules

If a rule has not been defined for a particular user segment, default ranking behavior will be applied. In other words, you can safely pass user segments that have not yet been defined.

If conditions from several rules apply to a given request their boost values will be summed up.