Source: https://nishanth-fern-test.docs-staging.pageloop.ai/web/survey-personalization

# Survey Personalization

Whatfix enables you to customize Surveys to provide a personalized experience for your end users. Use variables for Survey personalization. Add a variable inside a Survey and replace it with any value evaluated on the end user's page where the Survey is displayed.

For example, when you want a Survey to be displayed with the name of the application on which the Survey is displayed, you can create a variable and add it to the Survey. This variable fetches the application name associated with the attribute. The variable is replaced with the application name.

## How to add a variable in a Survey?

Use the following steps to add a variable in a Survey:

1. Log in to the application where you want to create content, and then launch the Whatfix Studio. ![CLM\_editor plug in2](/images/f6/CLM_editor-plug-in-2-f67cdef9.png)

2. Under **WIDGETS**, click **Survey**. ![clm\_studio\_survey](/images/8c/clm_studio_survey-8c847068.png)

3. Enter a name for the Survey. ![clm\_survey\_survey name](/images/42/clm_survey_survey-name-42c367dd.png)

> [!INFO]
>
> The Survey name is solely for your reference and is not visible to the end user.

1. Make the following configurations to your Survey header.

![Survey\_header](/images/9e/Survey_header-9e138289.png)

- Enter the **Title**.
- Enter the **Description**.
- Change the **Background color**, **Text color**, and select the checkbox to show '\*' for the mandatory questions according to your requirement.

2. Select the **Question type** using the dropdown, and then enter the question. ![Survey\_add\_condition](/images/9d/Survey_add_condition-9d34a7f4.png)

> [!WARNING]
>
> You cannot edit the survey once it is live.

1. Add a variable that needs to be replaced with the data evaluated from the end users' page. Add the variable in the following format: **{{Attribute}}**

> [!INFO]
>
> Replace the word 'Attribute' with any other word as per your use case. For example, use {{Application}}, {{Name}}, etc.

> [!WARNING]
>
> Add the following code in the Advanced Customization(AC),
>
> ```plaintext
> window._wfx_settings.survey_data = {
>   "params":{
>   "attribute" : window.a,
>   "application" : window.b,
>   "tag" :"Whatfix"     
>  }
> };
> ```
>
> where,
>
> - **attribute**, **application**, and **tag** are the variables created.
> - **window\.a**, **window\.b**, **Whatfix** are the attributes that fetch the values evaluated from the end users' page on which the Survey is shown.

> [!WARNING]
>
> You cannot edit the Survey once the Survey is published. However, you can edit the Survey in the Draft and Ready stages.

1. To add a new question, click **+ Add Question**. ![Add questions to a survey](/images/a2/Studio_Surveys_Addquestion-a25c8771.png)
2. To add conditions, click the **Add condition** icon. The condition enables you to determine which question appears next based on the users' response. ![Add conditions to a survey](/images/da/Studio_Surveys_AddConditions-1-da89eb4c.png)

> [!INFO]
>
> - For more information on the different question types, see [Question Types in Survey](https://support.whatfix.com/studio/docs/question-types-in-survey).
> - To make a question mandatory, enable the **Required** toggle on. ![Enable the Required toggle on to make a survey question mandatory](/images/04/Studio_Survey_Mandatory-043c413a.png)

1. Edit the **End Message** section ![Survey\_end\_message](/images/e1/Survey_end_message-e1699cd0.png)

You can make the following configurations to your Survey header.

- Type the **Message**.
- Add the **Subtext**.
- In the **Close button text** section, edit the text as required.
- Change the **Background color** and the **Text color** of the Close button according to your requirement.

2. On Whatfix Studio, under the **CONTROL** panel, enable the following toggles:

- **Dismissable**: Enable this toggle to give your end users' an option to close/dismiss the Survey.
- **Minimize**: Enable the toggle to give your end users' an option to minimize the Survey and defer taking the Survey.
- **Allow anonymous responses**: Enable the toggle if you don't want to collect the responder's data.
- **Don't show me again**: Enable the toggle to include a don't show me again button. Once the end user clicks it, the Survey won't be shown again irrespective of the occurrence set.
- **Position survey**: Enable the toggle to change the positioning of the survey.

![survey\_control\_panel\_clm](/images/02/survey_control_panel_clm-024ab1f4.png)

1. Click **Save**. ![clm\_survey\_quiz\_save](/images/0f/clm_survey_quiz_save-0fbbab67.png)
2. On the Dashboard, in the **Widget** section, hover your cursor over the Survey you want to edit, and then click the **Edit** icon. ![ia\_edit\_survey](/images/f8/ia_edit_survey-f8487d55.png)

> [!INFO]
>
> If you have the enhanced Whatfix Dashboard, use the following steps:
>
> a. On the Whatfix Guidance dashboard, click **Widgets**.
>
> ![ia\_left\_nav\_widgets](/images/d4/ia_left_nav_widgets-d468b7f8.png)
>
> b. Click **Surveys**. ![ia\_left\_nav\_surveys](/images/ef/ia_left_nav_surveys-efec7e0d.png)

1. Click **Set Visibility Rules**. ![DB\_Survey\_set VR](/images/24/DB_Survey_set-VR-241f7146.png)
2. Set the **Where does the survey appear?** Visibility Rules for the survey to appear. ![DB\_Survey\_set where VR rules](/images/81/DB_Survey_set-where-VR-rules-816af5e1.png)

> [!INFO]
>
> - For more information, see [Visibility and Display Rule Conditions](/desktop/visibility-and-display-rule-conditions).
> - If you use new visibility rules, see [New Visibility Rules for Widgets](/web/advanced-visibility-rules-for-widgets).

1. Set the **When does the survey start appearing?** Visibility Rules for the survey. ![DB\_Survey\_when VR rules](/images/96/DB_Survey_when-VR-rules-9696870d.png)

> [!WARNING]
>
> Once the user responds to the survey, the survey won't be shown again, irrespective of the occurrence set.

1. Click **Edit Survey** or **Save** depending on your preference. ![clm\_survey\_edit or save the survey](/images/00/clm_survey_edit-or-save-the-survey-00588837.png)
