Implementation Steps - Step 3: Add script tag to site
This is the standard implementation option using just one file reference. In most cases this method works fine.
The client must paste the following line of code as high up on the page as allowed. It is recommended to place the code between the
</head> tags for optimum performance. However, this code typically runs fine from anywhere on the page.
This option is favorable if the site uses a large amount of scripts and has areas that tend to load slowly. The OnExit survey relies on timers to know when the user has left the site before presenting the survey. Pages that load slowly may cause a timer to falsely identify an “exit” condition. This second option allows for the larger
foresee-trigger.js file to be placed at the bottom of the site after other slower loading scripts, while the smaller
foresee-alive.js is placed near the top above slower loading scripts. The
foresee-alive.js is a very small file used only to alert the code that the session is still alive and to check for the
foresee-trigger.js file to load before considering an exit condition.
The client must paste the reference to the
foresee-alive.js file as high up on the page as allowed. It is recommended to place the code between the head tags for optimum performance.
The second reference to the
foresee-trigger.js file can be placed anywhere lower on the page.