Adding a Web Overlay Survey to SFDC Communities

Back to Help Center

Adding surveys to your knowledge base is a great way to measure customer effort, and the efficacy of your knowledge base. By identifying under performing articles and notifying your team about how they can be improved, you can allocate support resources effectively. We have two methods of implementing surveys within Salesforce Communities: our lightning component and our web overlay survey.

You can use the free GetFeedback Lightning Component, which is available on the Salesforce AppExchange to quickly and easily install surveys within your Community. While this method will track the title of the page on which it is located, the Lightning Component is not set up to track additional user information via merge fields. Find more information about the Lightning Component.

If you'd like to attach merge field data to your survey, we recommend using Web Overlay. Let's run through how to install a Web Overlay survey on your Salesforce Community.

Setting up your Web Overlay Survey

WebOverlayNavigation
weboverlayjavascriptinstructions

Add the Survey to your Community Builder

kA61J000000VcIbSAK_en_US_1_3

Public vs. Private Salesforce Communities

If you're adding a GetFeedback survey to a public Salesforce community, all you need to add to the "Head Markup" is the copied instructions above.

If you're adding a GetFeedback survey to a private Salesforce community where a login is required, you'll want to add this code in addition to code copied from GetFeedback, this will allow the survey to be hidden by default:

<script>
var styleElement = document.createElement('style');
styleElement.id = 'gf-embed-id';
styleElement.innerHTML = '.gf-Bobblehead-wrapper, .gf-Widget {display: none;}';
window.setTimeout(function() {
document.head.appendChild(styleElement);
},1000);
</script>

Then you'll include this code below to add a Visualforce page to check if the survey should be shown on the Salesforce Community:

<apex:page>
<script>
<!-- Reference a Salesforce User Preferences field to dynamically show/hide the survey widget -> if ({!$User.Disable_Embedded_Surveys__c} == false) {
document.head.removeChild(document.getElementById('gf-embed-id'));
}
</script>
</apex:page>

Be sure to replace User.Disable_Embedded_Surveys__c with the desired Salesforce field you'd like to use to either show or hide the survey.

Tracking Additional Information With Merge Fields

If your survey needs to have merge field metadata attached, dynamically show or hide the overlay depending on a field value, we’ll need to create a Visualforce page with any custom code needed to perform the desired function. Some example functionality is shown below:

This block of code specifies the merge fields that we'll be including in the survey for tracking purposes:

<apex:page>
<script type="text/javascript">
<!-- Append merge field data to your survey using set Parameters method. Note that merge fields added in this way CANNOT be used for survey personalizations nor skip logic operators -->
gf('setParameters',{'ContactID':'{!$User.Id}'});
</apex:page>

kA61J000000VcIbSAK_en_US_1_4

Make Security Adjustments

Add GetFeedback as a Trusted Site within Community Settings

kA61J000000VcIbSAK_en_US_1_5

Add GetFeedback to your CSP Trusted Sites through Salesforce Setup

kA61J000000VcIbSAK_en_US_1_6

Turn your Survey on

web overlay enable

© 2020 GetFeedback, Inc.|888-684-8821|Terms of use|Privacy notice|California privacy notice

*Net Promoter, Net Promoter System, Net Promoter Score, NPS and the NPS-related emoticons are registered trademarks of Bain & Company, Inc., Fred Reichheld and Satmetrix Systems, Inc.