-
Notifications
You must be signed in to change notification settings - Fork 0
Javascript SDK Start Survey Programmatically
Samuel Berthe edited this page Nov 15, 2022
·
3 revisions
In most cases, you should let the Screeb targeting engine start the survey. But sometimes, you may need more control on survey trigger time.
This method is often used for adding feedback button into a menu.
$screeb('survey.start', '<SURVEY_ID>'); If current user already replied to your survey and you would rather not display it many times, please add the allow_multiple_responses argument:
$screeb('survey.start', '<SURVEY_ID>', { 'allow_multiple_responses': false }); The survey.start command accepts an object of hidden fields. Values passed as parameters will be listed alongside the responses, on the Screeb platform.
$screeb('survey.start', '<SURVEY_ID>', { 'hidden_fields': { 'color': 'green', 'article_id': 42 } });