The Trigger module is included in the ForeSee® Replay for Mobile SDK and is the functionality 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:

  • The number of times the app has been launched.
  • The elapsed time since the app was first launched.
  • The number of pages viewed since the app was first launched.
  • The elapsed time since the app was last launched.
  • Custom events.

If any of these criteria are fulfilled, an invitation is shown.

Once an invitation has been displayed, the user can choose to accept or decline. If they choose to accept the invitation, the user is shown a survey. Whether the user accepts or declines, they can be re-invited at a later date based on the values set for the following keys in the configuration:

  • After declining an invitation - repeatDaysAfterDecline
  • After completing a survey - repeatDaysAfterComplete
  • After ignoring an invitation received in local invitation mode - repeatDaysAfterAccept

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.

Trigger Customization

All Trigger behavior is defined in the foresee_configuration.json file included with the SDK. This file must be added to your 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 your customerId, defines a unique survey. This allows you to configure multiple measures in your app.

Triggering Sequence

The determination of a user's eligibility to participate in a survey is done through a single method:

[ForeSeeCxMeasure checkIfEligibleForSurvey];

Calling this method initiates the following sequence of events:

  1. Determine if the user has fulfilled the loyalty criteria for any defined measure.
  2. Make an HTTP request to the ForeSee server to see if the user is in the sampling pool.
  3. If the user has fulfilled the trigger criteria and is in the sampling pool, the default invitation is presented.
  4. If the invitation is accepted, depending on which invitation mode is configured, the survey is either presented immediately inside your application, or, the user is notified to participate at a later time.
  5. If the user declines, the invitation is dismissed.