Script: End Session
This article will help you End Session
Background
You may need to end your session right away so a respondent can come back and take a survey multiple times.
- Examples of why you would need to do this are:
- If you needed to have a landing page.
- If the end client wants to test multiple times using the Live link so they can see what a real respondent would see
Implementing the End Session
- Turn off Digital Fingerprinting, if you have not already, for the specific sample sources needed. This will turn off the termination tied to use of the same machine/ip address.
- See Article: Sample Sources: Fingerprinting
- Get the 'Project ID' you are working on
- See Article: Getting Your Project ID
- Access the Survey Authoring Tool (SAT)
- Click on 'Survey Settings' followed by 'Default Text' to open that Card in the main screen
- Click on the HTML Editor icon tied to the 'Survey Header'
- Access the Source Code Editor (</>)
- See Article: Source Code Editor
- While in the Source Code Editor, add the following code and update the '99999' with the one you got in step 2 above
<script> function clearSession(projectId) { document.cookie = 'cmix-rid-prj-' + projectId + '=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/'; document.cookie = 'cmix-rid-test-' + projectId + '=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/'; document.cookie = 'cmix-rid-rt-' + projectId + '=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/'; } clearSession(99999); /*UPDATE PROJECT ID HERE*/ </script>
- You are done
- NOTE
- If this was done just for testing as a live person by the end client, you will want to:
- Turn Fingerprinting back on if you do not want the same machine/ip address to be able to take the survey multiple times
- Remove the End Session code
- If this was done just for testing as a live person by the end client, you will want to: