ForeSee Developer Portal

Everything you need to set up and optimize your ForeSee product. Home of developer documentation, implementation guides, and question/answer forums.


Testing Client Code

Staging Snippet

ForeSee will provide you a Staging Snippet that can be used for testing. This code 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, gives you all you need to test your specific code configuration.

The Staging URL's

Either one of these URL's work for most clients. Clients new to ForeSee as of February 7, 2017 are using 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 *****************************************

Testing Tool - Survey Administration

The triggering code embedded on your site comes pre-configured for the business rules related to your production environment. 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 for the testing session only.

A further explanation of the rules that can be configured in the testing tool is found in the Invitation Behavior article.

Note on the Testing Tool

Using this testing tool 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 of your site, and then refresh the page. For example, if your site is 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

Figure 1

Testing Client Code