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
If any of these criterion are fulfilled, an invitation is shown.
Once an invitation has been shown, the user can choose to accept or decline. If they choose to accept the invitation, they are shown a survey. They will be re-invited at a later date based on the values set for the following keys in the configuration:
- After declining an invitation –
- After completing a survey –
- After ignoring an invitation received in local invite mode –
All counters are reset the first time the eligibility is checked after the relevant repeat days have been exceeded. The user receives another invitation once they have re-met the trigger criteria.
All Trigger behavior is defined in the
foresee_configuration.json file included with the SDK. This file must be added to the client’s project.
A survey and its loyalty criteria are represented in the configuration file as measures. Every measure has a unique surveyId and defines loyalty criteria specific to that survey. The surveyId together with the client’s customerId defines a unique survey. This allows the client to configure multiple measures in their app.
The determination of a user’s eligibility to participate in a survey is done though a single method:
Calling this method initiates the following sequence of events:
- Determine if the user has fulfilled 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 is either presented immediately inside the client’s application or the user will be notified to participate at a later time.
- If the invitation is declined, the invite is dismissed.