Client Code (Web SDK) - Testing Client Code

Staging Snippet

ForeSee will provide you a staging snippet that can be used for testing.  This snippet can live in your testing environment in order for you to thoroughly test any changes prior to promoting them to your production environment.  The staging snippet, used in conjunction with the administration page below, will give you all you need to test your specific code configuration.

The Staging URL’s

Either on of the URL’s should work for most clients.  Clients new to ForeSee as of February 7, 2017 will use the “” snippet below.

  • //[sitekey goes here]/staging/gateway.min.js
  • //[sitekey goes here]/staging/gateway.min.js

Example of a Staging snippet:

// DO NOT MODIFY BELOW THIS LINE *****************************************
;(function (g) {
var d = document, am = d.createElement('script'), h = d.head || d.getElementsByTagName("head")[0], fsr = 'fsReady',
aex = {
"src": "[//[your sitekey]/staging/gateway.min.js]",
"type": "text/javascript",
"async": "true",
"data-vendor": "fs",
"data-role": "gateway"
for (var attr in aex){am.setAttribute(attr, aex[attr]);}h.appendChild(am);g[fsr] = function () {var aT = '__' + fsr + '_stk__';g[aT] = g[aT] || [];g[aT].push(arguments);};
// DO NOT MODIFY ABOVE THIS LINE *****************************************

Change Criteria while you test

The triggering code embedded on your site comes pre-configured for the business rules related to your production environment. This means that in order to receive a survey invitation it is possible that a very low sampling percentage or pooling number decreases the chance of the user receiving an invitation. This could potentially make testing difficult. Therefore, in order to receive the invitation/survey while testing, a Survey Configuration Testing page (Figure 1) is provided which allows the invitation to display at a frequency of choice and for the testing session only. There is an option to override the Pooling percentage (if less than 100%), which is necessary for the session to be recorded and the survey invitation to appear. See more about Pooling below.


Using this test page does not change the sampling percentage in the JavaScript code and therefore doesn’t affect site users. Please keep in mind that when cookies and cache are cleared between each test, it may be necessary to navigate back to this test page and reset the increased sampling parameters.

To access the survey configuration page, simply add the hash #acscommand=fstest to the end of any URL on your site, and then refresh the page. For example, if your site was located at, you would edit the address bar to read, press enter, and then refresh the page. You should see something like what is depicted in the screenshot below.

Figure 1

Articles in this section:

  1. Verify Invitation Display
  2. Verify that Replay is Working