Trigger - Trigger Overview
The Trigger module is included in the ForeSee Replay for Mobile SDK and is responsible for inviting a user to participate in a satisfaction survey. Trigger can be configured to invite a user to participate based on “loyalty” which is defined according to a number of different criteria including:
- Number of times the app has been launched
- Time since the app was first launched
- Pages viewed since the app was first launched
- Custom events
In addition, the client can define whether or not a user can be re-invited and how many days to wait before re-inviting.
All Trigger behavior is defined in the
foresee_configuration.json file included with the SDK. This file must be added to the project.
A survey and its loyalty criteria are represented in the configuration file as measures. Every measure has a unique Survey ID and defines loyalty criteria specific to that survey. The Survey ID together with the client’s Customer ID defines a unique survey. This allows the client to configure multiple measures in the app.
Determining whether or not a user is eligible to participate in a survey is done though a single method:
Calling that method initiates the following sequence of events:
- Determine if the user has fulfilled any of the loyalty criteria for any defined measure.
- Make an HTTP request to the ForeSee server to see if the user is in the sampling pool.
- If the user has fulfilled the trigger criteria and is in the sampling pool, the default invitation is presented.
- If the invitation is accepted, depending on which invite mode is configured, the survey either presents immediately inside the application or the user is notified to participate at a later time.
- If the invitation is declined, the invite is dismissed.