ForeSee Developer Portal

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

Blueprint

Customer Passed Parameters

Customer Passed Parameters (CPPs) Overview

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

  1. Adding CPPs may increase cookie size.
  2. Internet Explorer limits the number of characters in a URL string to 2084 including the URL to the survey. If additional CPPs cause the URL to exceed this limit, data may not be passed with the survey and, therefore, unavailable in the respondent data.

Setting CPP's

Setting a CPP with the CPP API

The API in the Setting a CPP code sample below can be used to manually set a CPP on the client’s site. This code can be duplicated as many times as desired, taking care that it’s placed below the Client Code snippet (versions 18x and above), or the call to foresee-trigger.js (versions below 18x) on the page.

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 hard-coded value, or a dynamic variable which can be customized to pass whatever data is preferred.


// When adding the CPP API this should appear BELOW the ForeSee embed snippet
fsReady(function() {
     FSR.CPPS.set('name','value'); //  use single quotes when passing a static-value
     FSR.CPPS.set('name2',somevariable); //   don't use quotes for a dynamic value
     FSR.CPPS.set('name3',othervariable); //   add as many CPPs as you like in this way
});

Additional note on API Usage: Because the ACS client code is loaded asynchronously, we provide a callback fsReady() that you can use to guarantee that any interaction you may have with our JavaScript API’s will wait until our modules have finished loading. You would use this the same way that you would use a DomReady callback to guarantee that code runs after the page is ready

Setting CPPs From Client Code Configurations

The following capabilities must be added by a member of the Implementation Team. You can request these changes from your ForeSee Client Contact.

  • Pass the value of a JavaScript variable - Using JavaScript variable name/value.
  • Pass the value of a cookie - Using cookie name.
  • Create a CPP using a URL - e.g., if the URL string contains "xyz" set a value of "Y."
  • Create a CPP using a URL query string parameter - e.g., Find "paramname=" in the URL and grab the value.

Reading CPP Values

Reading CPPs from the API function (Client Code 19.3.3 and above)

Use the FSR.CPPS.all function to read the values of the CPPs that have been set. The CPP values can be either read all at once, selectively. Here is a code sample.

fsReady(function() {
    FSR.CPPS.all(function (r){
        console.log("List of CPPS: ", r);
    });
    FSR.CPPS.get('my_cpp_name', function(val) {
        console.log("CPP value: ", val);
    });
});

Reading CPPs with the Survey URL

When a survey questionnaire appears, find the CPP parameters in the URL string:

http://survey.foreseeresults.com/survey/display?sid=browse-clientsite.com-en&cid=gcdwU50NZxxRxwJI1IEw%3D%3D&pattern=http%3A%2F%2Fwww.clientsite.com%2F&a=1293032648063_751683&b=38790979455466765205&c=86400000&version=5.0.0&cpp[orderDate]=12%2F22%2F2010&cpp[TLSessionID]=4EEBFE540DE2100D7A51B7D51C444613&cpp[browser]=Firefox%203.6&cpp[os]=Windows&cpp[pv]=2&cpp[url]=http%3A%2F%2Fwww.clientsite.com%2F&cpp[ref_url]=&cpp[locale]=en&cpp[site]=clientsite.com&cpp[section]=&cpp[referrer]=&cpp[terms]=&cpp[sessionid]=1293032648063_751683&cpp[replay_id]=&cpp[flash]=10

Reading CPPs from the fsr.s cookie (Client Code 19.0.x and below)

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

"cp":{"ads":"none","icmpid":"none","cmpid":"none","icid":"none","cid":"none"},

Articles in this section:

  1. Default CPPs

Customer Passed Parameters