Code File Library - Testing Outside Production

When the client is testing in a different environment or using a different host than production then they may need to modify the ‘sites’ parameter in the following files:

  • foresee-alive.js
  • foresee-test.js
  • foresee-tracker.js
  • foresee-trigger.js
  • foresee-qualifier.js (if applicable)

The ‘sites’ definition in the Production Environment code sample is meant to work in any qualified domain. The regular expression in the ‘path’ area determines the root domain in which the ForeSee cookies are dropped. For example, if the site is ‘www.xyz.com’ or ‘products.xyz.com’ then the cookies are dropped in ‘xyz.com’ domain.

This is the recommended method for production web sites. It is important in most cases that the cookies be dropped to the root domain, especially if the site has sub-domains and is using the onExit method for presenting a survey.

Production Environment:

var $$FSR = { 
    // {omitted code} 
    'pools': [{ 
        path: '.', 
        sp: 100 // CHANGE ONLY WHEN INCLUDING SESSION REPLAY 
    }], 
    'sites': [{ 
        path: /\w+-?\w+\.(com|org|edu|gov|net|co\.uk)/
    }, 
    { 
        path: '.', 
        domain: 'default' 
    }], 
    storageOption: 'cookie', 
    nameBackup: window.name 
};

The ‘sites’ definition in the Test Environment code sample is meant to work in an environment WITHOUT a qualified domain (localhost or IP address). The dot (.) in the ‘path’ area is meant to be a wild card and drops the cookies into whatever domain is present. For example, if the client is testing in their LOCALHOST environment then the cookies are dropped in the domain ‘LOCALHOST’.

Test Environment:

var $$FSR = { 
    // {omitted code} 
    'pools': [{ 
        path: '.', 
        sp: 100 // CHANGE ONLY WHEN INCLUDING SESSION REPLAY 
    }], 
    'sites': [{ 
        path: /\w+-?\w+\.(com|org|edu|gov|net|co\.uk)/ 
    }, 
    { 
        path: '.', 
        domain: 'default' 
    }], 
    storageOption: 'cookie', 
    nameBackup: window.name 
};

Other articles in this section:

  1. Explanation of Files
  2. Code Switches
  3. Disabling the Code
  4. Alternate Directory Structures
  5. Separating Files by Type
  6. Separating Files by Environment
  7. Hosting the Code from a Third Party Domain
  8. Changing Survey Behavior
  9. Using Tag Managers
  10. Replay Sampling & Pooling
  11. Testing Outside Production (current article)
  12. Flash and DHTML
  13. Customer Passed Parameters (CPPs)
  14. Minimizing Cookie Size