Code File Library - Customer Passed Parameters (CPPs)

Customer Passed Parameters (CPPs) are used to send data points available on the client’s website along with the survey response. The value of these parameters can be used for segmenting the client’s respondent data. The client may send as many parameters as desired using the methods described in this topic. ForeSee suggest limiting CPPs to meaningful data intended for specific reporting.

IE limits the number of characters in a URL string to 2084 including the URL to the survey. If additional CPP’s cause the URL to exceed this limit, data may not be passed with the survey and unavailable in the portal.

Method 1: The CPP API

The API in the Setting a CPP code sample can be used to manually set a CPP on the client’s site. This line can be duplicated as many times as desired, taking care that it’s placed below the call to foresee-trigger.js on the page. The foresee-trigger.js must be loaded first to avoid failing due to the FSR object not being defined.

In the following example, ‘name’ is the name of the CPP to be passed and viable in the portal. The value can be either a static hardcoded value, or a dynamic variable which can be customized to pass whatever data is preferred.

Setting a CPP:


Method 2: Adding CPPs to the code

This method of adding CPPs keeps all the CPP logic directly in the code’s configuration file (foresee-surveydef.js file). This method is helpful because it keeps all the logic in one place and helps ensure the CPP logic isn’t accidentally removed during a site change.

The following snippets of code can be added to the ‘’ section of the foresee-surveydef.js file.

It is recommended to always set up an “init” value as “N”, “None”, “Null”, “False”, etc. so that the CPP is not left blank in the portal when a value isn’t present. It is not possible to segment on blank values.

Passing the value of a variable:

The following code sets a CPP called ‘category’ passing the value of a variable on the site called ‘cat’. = {
   cpps: {
      category: {
         source: 'variable',
         name: 'cat',
         init: 'none' //initial value of CPP if no variable exists

Passing the value of a cookie

The following code sets a CPP called ‘authenticated’ using a cookie with the name ‘auth’. = {
   cpps: {
      authenticated: {
         source: 'cookie',
         name: 'auth'
         init: 'false' //initial value of CPP if no cookie exists

Creating a CPP using a URL

The following code sets a CPP called ‘support’ with a value of ‘true’ when the URL contained a string like ‘/support’. = {
   cpps: {
      support: {
      source: 'url',
      init: 'none', //initial value of CPP if pattern isn’t present
      patterns: [{
         regex: '/support',
         value: 'true'

Creating a CPP using a Meta Tag

The following code sets a CPP called ‘CountryCode’ with the value of the Meta tag named ‘DCSext.CountryCode’. = {
   cpps: {
      CountryCode: {
         source: 'meta',
         init: 'none', //initial value of CPP if no meta tag exists
         name: 'DCSext.CountryCode'

Creating a CPP using a URL query string parameter

The following code sets a CPP called ‘q’ with the value of the parameter in the URL. = {
   cpps: {
      searchterms: {
          source: 'parameter',
          name: 'q'

How to know if CPPs are being passed

Method 1: fsr.s cookie

Open the fsr.s cookie to view the parameters inside the “cp” attribute. CPPs are listed as name then current value to be passed.


Method 2: Survey URL

When a survey questionnaire appears, find the CPP parameters in the URL string:[orderDate]=12%2F22%2F2010&cpp[TLSessionID]=4EEBFE540DE2100D7A51B7D51C444613&cpp[browser]=Firefox%203.6&cpp[os]=Windows&cpp[pv]=2&cpp[url][ref_url]=&cpp[locale]=en&cpp[site][section]=&cpp[referrer]=&cpp[terms]=&cpp[sessionid]=1293032648063_751683&cpp[replay_id]=&cpp[flash]=10

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. cxReplay Sampling & Pooling
  11. Testing Outside Production
  12. Flash and DHTML
  13. Customer Passed Parameters (CPPs) (current article)
  14. Minimizing Cookie Size