Calling the Engine API

Request Filtering

The monetate:decision:DecisionRequest event supports two types of filtering:

  • The slots=[] attribute expects an array of strings, each of which is a slot name for an Engine API action (for example, omni_redirect). Only actions that have slot names matching one of the specified slots are evaluated, and for each slot the highest-priority action matching that slot is returned.
  • The actionTypes=[] attribute expects an array of strings, each of which is an action type for an Engine API action (for example, monetate:action:OmnichannelJson). Only actions that have an action type matching one of the specified action types are evaluated. Unlike the slot filters, it's possible to qualify for multiple actions with the same action type.

If the slots attribute is missing or consists of an empty array, then no slot filtering is performed. If the actionTypes attribute is missing or consists of an empty array, then no action type filtering is performed. If both slots and actionTypes are specified, then actions must match both the slots and actionTypes filters to be evaluated.

In this monetate:decision:DecisionRequest example request, the event considers only Omnichannel redirect actions using the slots=[] approach.

Example monetate:decision:DecisionRequest Request with Filtering


Redirect Actions

When a monetate:decision:DecisionRequest event that doesn't include slot filtering is submitted, the customer might qualify for redirect actions, non-redirect actions, or some combination of the two:

  • If the customer qualifies for a redirect action and is assigned to the experiment group, then only that action is returned in the response.
  • If the customer qualifies for multiple redirect actions and is assigned to the experiment group for each of them, then the action with the highest priority is returned.
  • If the customer doesn't qualify for any redirect actions or is assigned to the control group for all redirect actions they do qualify for, then all non-redirect actions are returned.

Single-request full-page redirects also work when the monetate:decision:DecisionRequest event includes the attribute managedImpressions=True:

  • If the customer qualifies for a redirect action and is assigned to the experiment group, only that action is returned in the response. The action includes an impressionId token that should be reported back to Monetate when the redirect occurs.
  • If the customer qualifies for a redirect action but is assigned to the control group, that redirect action is still included in the response and has an associated impressionId token, but the response indicates that it's a control action with the isControl=True flag.

The impressionId token for a given redirect action must be reported back to Monetate regardless of whether the customer is in the experiment group or the control group. See Managed Impressions for details about when and how to report the impressionId token.

The customer should only be redirected to the URL included in the action if isControl=False.

Example Client-Side Logic