Present the terms and conditions document in a link, and have people 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 AcceptDate1.
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 AcceptDate1 (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 "AcceptDate1."
- 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, add the instruction text and create a hyperlink to the Terms and Conditions.
For example, "Do you accept the Terms and Conditions for our community? Please review the provided link." Make "Terms and Conditions" a hyperlink.
- 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 "Please confirm."
- 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 AcceptDate1 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 AcceptDate1 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 AcceptDate1 value.
- Preview and test your survey.
Script
/*
Script Name: How do I display terms and conditions to survey participants as a link 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('AcceptDate1');
// 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);
}