Create reactors for joining or leaving an audience

Introduction

Reactors that trigger when an end-user joins or leaves an audience is a great way to incentivise and reward specific behaviour. You can use them in addition to your main loyalty offering, or even as part of the core logic of your program.


Configuration

The AUDIENCE_JOINED and AUDIENCE_LEFT events will not appear in your event types list until you have created an audience with them enabled.

The setup of the reactor is identical for both AUDIENCE_JOINED and AUDIENCE_LEFT events, so this tutorial will combine the two.

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

  2. Give the reactor a name and choose AUDIENCE_JOINED or AUDIENCE_LEFT from the 'Event type' list.

  3. Choose whether you want this reactor to occur an unlimited number of times or be limited to user or tenant activations.

  4. Move to the 'Payload Constraints' tab. Click 'Is Audience' in the 'Audiences' section. Select the audience you want the AUDIENCE_JOINED or AUDIENCE_LEFT event to be related to in order for this reactor to trigger. This will create a JSON schema which references the audienceId of that audience.

  5. Move to the 'Reactions' tab. Configure the reaction as needed. For more information about how to configure a reaction see the Activation limits page.

  6. Optional - Move to the 'Effectivity' tab. Set a start date and an end date for the reactor. If you'd like the reactor to run immediately and indefinitely skip this step.

  7. Click 'Save'.


Tips

  • Not selecting a particular audience in step four of the tutorial will mean that the reactor will trigger when an AUDIENCE_JOINED or AUDIENCE_LEFT event is reported for any audience.

  • Depending on your audience criteria setting an activation limit may not be needed in order to ensure the user only triggers the reactor a certain number of times. Consider adding one as an extra layer of security. For example;

Imaging you have an audience which an end-user joins when they make their first purchase. A corresponding AUDIENCE_JOINED reactor for this audience wouldn't need an activation limit, as a user is only ever going to be able to join that audience once. However, setting an activation limit ensures that if the audience criteria contained errors or was changed in the future then the user is still only going to be able to trigger the reactor once.

  • You can specify multiple audiences within the payload constraints by using the following schema in advanced mode. You can find the audienceId of an audience in the URL shown when viewing an audience in the console.

    {
        "type": "object",
        "$schema": "http://json-schema.org/draft-06/schema#",
        "properties": {
            "audienceId": {
                "type": "string",
                "enum": [
                    "audienceId1",
                    "audienceId2",
                    "audienceId3"
                ]
            }
        },
        "required": []
    }

Last updated

Was this helpful?