Code File Library - Minimizing Cookie Size

When there is a concern about cookie size there are a few options for decreasing the size of the cookies.

Un-encoding of the fsr cookies

Change the ‘encode’ flag to ‘false’. The ForeSee trigger cookies as a default are encoded. To un-encode them and reduce the size of the ForeSee cookie, change the parameter below in the following files:

  • foresee-alive.js
  • foresee-test.js
  • foresee-trigger.js
  • foresee-tracker.js
  • foresee-qualifier.js (if applicable)
var $$FSR = { 
   'timestamp': '__buildtimestamp__', 
   'version': '__version__', 
   'build': '__buildnumber__', 
   'enabled': true, 
   'frames' : false, 
   'sessionreplay': true, 
   'auto' : true, 
   'encode' : true,

There are some items of interest that the ForeSee trigger code captures which may be interesting to clients. The referring URL and search terms, the URL where the survey was presented, and the user entry page are examples. Those items are, at some point during the visit, stored within the ForeSee cookie and can increase the size significantly depending on the site. If one or more of these parameters is not desired, the collection of them can be disabled in the foresee-surveydef.js file. Find the following snippet of code with the default values and revise the items accordingly.

meta: {
  referrer: true, // captures referring domain 
  terms: true, // referring domain search terms
  ref_url: true, // referring url (full string) 
  url: true, // URL of page where survey was presented 
  url_params: false, // URL params of page where survey was presented 
  user_agent: false, // full user agent
  entry: false, // entry page of visitor
  entry_params: false // entry page of visitor (full string)

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
  12. Flash and DHTML
  13. Customer Passed Parameters (CPPs)
  14. Minimizing Cookie Size (current article)