Display full terms and conditions text in the survey and asks participants to accept or decline. A script and hidden question track the date of the acceptance response.
Example
Sample survey structure:
Responding view:
Detailed Steps
- Create a Date profile variable named AcceptDate2.
This Date profile variable will be used to store the date on which participants accepted the terms and conditions.
Note: You can name it anything you like. If you use a name other than AcceptDate2 (which is used everywhere in this article and in the script), you must change it everywhere.- Click the App Drawer and select Profile Variables.
- Click + Profile Variables.
- In the Variable Name field, type "AcceptDate2."
- In the Description field, type what this profile variable will be used for.
For example, "Track terms and conditions acceptance in [Activity Name]." - From the Type menu, select Date.
- Click Save.
- In the survey, add a Text and Image element and name it Terms and Conditions.
- Open the Text and Image element for editing.
- In the Instruction text field, copy and paste your terms and conditions text in its entirety.
- On the same survey page, below the Text and Image element, add a Single Choice question and name it Accept Terms Click.
- Open the Single Choice question for editing.
- In the Question text field, type "Do you accept the terms and conditions?"
- Add "Yes" and "No" as answer options.
- On the same survey page, below the Single Choice question, add a hidden Profile action that references the AcceptDate2 profile variable.
This Profile action will be used to record and track the acceptance date. - Add a script to the survey page.
- Click the Page element to open it for editing.
- Click the Scripting button.
- Copy and paste the script below into the On Complete tab.
- Update the AcceptDate2 value if necessary.
- Click Save.
- On a new survey page, add a Text and Image element and name it Results.
This helps with testing and making sure the values are recorded as expected. You can hide this element before distributing the survey.- In the Instruction text field, add a pipe for the Accept Terms Click value.
- Add a pipe for the AcceptDate2 value.
- Preview and test your survey.
Script
/*
Script Name: How do I display full terms and conditions text to survey participants and track their acceptance? (Modern Surveys)
To ensure your script works as expected, always copy the original script from the Script
Library found in the Alida Help Center. Failure to use the latest script from the script library
may cause unexpected results.
*/
//update to match your question name here.
const timerStart = response.getDataPoint('AcceptDate2');
// Get the current dateTime as a UTC string
var date = new Date();
// Check the 'start' hidden question to see if it has a value, populate it if not
const cur = timerStart.get();
if (cur == null){
timerStart.set(date);
}