In this article
A core part of an intercept program is the scenario. This is a JavaScript that is executed in the user’s browser (or mobile app) when they visit the web site. The scenario contains a specified set of conditions which, if met by the user, triggers the survey or invitation. A program can have many scenarios each defining a different set of conditions to be met - you must have one scenario for each situation, and there must be at least one scenario in a program. The JavaScript script controls the display of the invitations and surveys, and can check additional conditions such as the web page url, cookies, the date and time etc. It can pass custom data from the web site to a survey, it can add delays and it can implement behaviors. For example it could show the survey when the user is about to leave the page and moves the cursor to the address bar, or it could trigger an invitation when the user searches for something on the site but doesn’t find what they are looking for.
Each scenario can check for the specified conditions, select one invitation, container and survey from those linked to the program, and then display the invitation and/or survey as required. It can also include logic to create different combinations of invitations and containers, or cross-scenario interactions for example “if scenario 1 has been triggered, don’t trigger scenario 2” etc.
Important: When multiple scenarios are to be used in a script, the combined scenario script is created with the scenarios located in the order that they are listed in the program.
Drag and drop your scenarios to place them in the desired sequence.
Any global variables that may be needed in these scenarios must be created at the top of the list.
Note: If you want to pass data from the web page into the feedback survey, delay the loading of the survey invitation button until after the page load is complete.