Add surveys to your Salesforce Communities and knowledge base to get feedback on your articles and resources. With a web overlay survey, you can add a button to take your survey on one or more pages of your Community. You can also track merge fields using the web overlay.
If you want to embed articles directly into a Community page and don’t need to track merge field data, use our free lightning component instead.
To set up your web overlay survey:
Paste the Javascript snippet for your survey into your Community. You need to perform extra steps if you’re adding the survey to a private community (if people must log in to access your site).
If users need to log in to access your site, you’ll need to add a few more code snippets to the head markup.
Add code to hide the survey by default:
Add code to create a Visualforce page that checks if the survey should be shown:
Be sure to replace User.Disable_Embedded_Surveys__c with the Salesforce field you'd like to use to either show or hide the survey.
You can create a Visualforce page with any custom code needed to attach merge fields or trigger the survey based on a field value.
For example, the block of code below specifies merge fields to to track with survey responses:
Manage additional security settings to make sure your survey displays correctly. You’ll need to:
When you’re ready to turn on your survey:
Learn more about turning your survey on or off