Skip to main content
Skip table of contents

JSON Realtime Decision

Overview

A JSON Realtime decision allows you to make Realtime decisions based on pieces of JSON data persisted in a parameter within a visitor’s profile.

A JSON Realtime decision contains the following:

Visitor Parameter

This mandatory property represents the visitor profile parameter within which JSON to be used by the Realtime decision will be stored.

JSON Schema

Allows you to provide a piece of JSON, which will be used as the basis for determining the types of decision criteria available at the Realtime decision. At its initial display, the following text is shown:

You must supply a JSON schema; a validation error is raised prior its provision.

On selecting the button, the JSON Schema dialog is displayed. It contains the following:

  • Valid JSON document: you can paste or enter a JSON document in this multi-line field. The example provided will be used as a schema to establish the list of decision criteria types available to the Realtime decision. Selecting the OK button removes the dialog from display. If you provided a JSON example the property's text is changed as follows:

On invocation of Add new Decision Criterion, if an invalid JSON schema supplied, a warning is raised.

If a valid JSON schema was supplied, available JSON elements (objects, arrays and attributes) are listed in the Add New Decision Criterion dialog. In addition, standard Custom and Custom JSON decision criteria are available. The latter are covered separately.

You can select an element to use as the basis for creating a new decision criterion. On selection of the same, the new decision criterion is displayed in the Realtime decision and is selected automatically.

Edit mode

When displayed in edit mode, a JSON decision criterion appears as follows:

  • Name: of the JSON parameter.

  • Apply Filter: this Yes/No dropdown defaults to “No”. When set to “Yes”, the Operator and Value fields allows you to specify a filter to limit the decision’s targets.

  • Operator: a dropdown. The values available are type-specific; if the JSON element is numeric, Operator defaults to "=", and if string, to "contains".

  • Value: provision of a filter value is mandatory. Data entry is constrained in accordance with the JSON element's data type:

    • Decimal: defaults to "0.0000"; the maximum supported value is "9999999999.9999".

    • Integer: defaults to "0"; the maximum supported value is "9999999999".

    • String: a button is shown. Its label is set initially to “No values. Click to select”. Selecting the button displays the Specify Values dialog, in which you can specify one or more filter values.

Note that a validation error is raised in the event of adding the same value more than once. Having specified values, you can select the OK button or select off the dialog to close it. The values are displayed as a comma-separated list at the Additional Details panel and are also shown in a tooltip on hover.

  • Aggregate function: a dropdown field, in which available values are presented alphabetically. The following values are always available:

    • Any (the default)

    • Not any
      The following additional value is available if the selected JSON element is an array or an attribute of an object in an array:

    • Count
      The following additional values are only available at numeric JSON attributes:

    • Sum

    • Minimum

    • Maximum

    • Average
      If a value other than Any or Not Any is selected, the following additional fields are displayed:

    • [Operator]: set using a dropdown; defaults to "=".

    • [Value]: if the selected Aggregate function is Count, an integer field is supplied, otherwise a decimal field is used to specify the value. The property defaults to "0".

The following are shown when the decision criterion is based on a JSON array:

A read-only JSON criterion appears as per the following examples:

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.