Limit a reactor an audience

Introduction

Creating a reactor which can only be triggered when a user is in a particular audience is a popular way to offer bonus rewards to your end-users.

It can also be used to ensure that the end-user has met certain requirements, such as age verification, before they can earn points.

To see an example of a configuration that uses an audience constrained reactor see the Create advanced or multi-event reactors using Audiences article.


Configuration

  1. Navigate to Events > Reactors. Click 'Create in the top right corner.

  2. Give the reactor a name and choose the event you want to reactor the listen for from the 'Event type' list.

  3. Move to the 'Payload Constraints' tab. Click the 'In Audience' button in the Audiences section and select the audience the user must be part of for the reaction to trigger.

  4. Configure the reaction and effectivity. Click save.

Reactor being constrained to an audience

Tips

Limiting a reactor to only trigger for users NOT in a particular audience

It's possible to create a reaction which only triggers if a user is not in a particular audience by editing the JSON schema produced in step 3 of the configuration guide. After completing step 3, click 'JSON' in the BLOCK/JSON switcher to begin editing the JSON schema. Make the following adjustments to the schema.

  1. Add the line "not": { below the "audiences": { line (line 6 in the sample schema).

  2. Add an additional closing bracket } below the closing square bracket (line 13 in the sample schema).

Sample JSON schema to exclude users in a particular audience
{
    "type": "object",
    "$schema": "http://json-schema.org/draft-06/schema#",
    "properties": {
        "audiences": {
            "not": {
                "type": "array",
                "contains": {
                    "enum": [
                        "8807dc2d-8aa5-4d00-842b-1da4ae95f902"
                    ]
                }
            }
        }
    },
    "required": []
}

Last updated

Was this helpful?