Displaying a Post Chat Survey in Salesforce Chat

Back to Help Center

GetFeedback for Salesforce Chat immediately displays a survey after a chat session to measure the customer's experience with your support agent, or redirect your customers to a web-to-case survey if agents are no longer available. 

Before You Start

Make sure to enable Salesforce Chat in your Salesforce account. You can enable chat using Lightning Service Setup or Salesforce Classic. Either option works with GetFeedback for Salesforce Chat, but there will be one extra step to complete if you're using Lightning Service Setup.

Designing a Post-Chat Survey in GetFeedback

In GetFeedback, open or create the survey you want to display at the end of the chat. Remove the title page so that when your survey appears in the chat window, it displays correctly. It’s best to use a Customer Effort Score (CES) or Customer Satisfaction (CSAT) survey with a follow-up text area or structured question. However, you can use any survey or question type you want.

The example below shows a CES survey that displays right after a Salesforce Chat has ended:

Post Chat CES Survey

Connecting your Survey to Salesforce

Connect your survey to the Salesforce org that has live chat enabled. From your survey, select Mappings > Salesforce Custom Mappings, then select the Salesforce environment to connect your survey to.

Setting up Salesforce Chat in GetFeedback

Attach your survey to a Salesforce Chat button. You can attach a survey to multiple buttons, but each button can only have 1 survey. If you attach a survey to a button that already has a survey, the original survey will be removed.

To set up Salesforce Chat distribution from GetFeedback:

  1. From your survey, select Distribute > Website > Salesforce Chat.

  2. Select the Salesforce Chat Button to attach to your survey. If you don’t have any Salesforce Chat Buttons available, create one using the steps outlined by Salesforce.

  3. Select Attach this button.

  4. Select the Salesforce site to attach to the button.

Note: If you installed Salesforce Chat using Lightning Setup, your chat button won’t be associated with a Salesforce Site, and you’ll get an error in GetFeedback. To fix this error, select View in Salesforce, select Edit, and choose a force.com site in the Site for Resources field. Your Lightning settings won’t be overwritten.

Adding Trusted Domains in Salesforce

You may need to add *.salesforceliveagent.comto the CSP and CORS settings in Setup (not Service Setup).

  1. In Setup, go to Sites and update the following settings:

    • For Clickjack Protection Level, select Allow framing of site pages on external domains (Good protection).

    • Add the link to your page to the Trusted Domains for Inline Frames.

  2. In Setup, go to Session Settings, then add the site domain to Trusted Domains.

Digital Experience Settings

If your chat is on a digital experience survey page, make sure to update your digital experience site's CSP settings.

Using Merge Fields

We automatically attach merge fields to the survey link based on the chat session. The merge fields we add come from a few different Salesforce Chat Deployment APIs that your developer uses when setting up the Salesforce Chat button on your website. 

The Deployment APIs are addCustomDetail and findOrCreate.saveToTranscript. The first one allows you to add custom detail for each user, and the second allows you to attach the Salesforce Objects that were either found or created before the chat has been started.

We automatically attach a subset of the following list of post-chat values:

  • chatKey

  • startTime

  • requestTime

  • agentId

  • agentName

  • lastVisitedPage

  • disconnectedBy

Each of them will be in snake_case form and prefixed with chat_ .

no consultation (SF)
Please note

GetFeedback Support can’t consult on coding issues. Reach out to your Salesforce administrator for help implementing these features. These examples help you get started with our Salesforce integration and you may need to make changes for your organization.

Example: ?chat_key=32b68228-b86f-11e8-96f8-529269fb1459&chat_start_time=1536944676912&chat_request_time=1536964984331&chat_agent_id=0051XXXXXXXXXXX&chat_agent_name=Tym%20A&chat_last_visited_page=https://my-site.com/help&chat_disconnected_by=client

addCustomDetail

All custom detail that you define will be attached to the Survey URL as merge fields using the label as the merge field name (we will “snake_case” the labeland also prefix it with “chat_custom_”) and the value as the merge field value.

For example, if you use the following code:

liveagent.addCustomDetail(‘First Name’, ‘Kimberly’),

we add the following merge field to the survey url: ?chat_custom_first_name=Kimberly.

findOrCreate.saveToTranscript

All the Salesforce Objects that are found or created will have their IDs automatically attached to the Survey URL as merge fields. The object name will be the merge field name, and the object ID will be the merge field value.

For example, if you use the the following code:

liveagent.findOrCreate('Case')

.map('Subject', 'Case Subject', false, false, true)

.map('Status', 'Case Status', false, false, true)

.saveToTranscript('CaseId').showOnCreate();

We would add the following merge field to the survey url: ?caseid=5001XXXXXXXXXXXXX.

Mapping to Salesforce

You can map survey responses to Salesforce using our managed mappings package or your own custom mappings.

Using Managed Mappings

If you use our managed mappings package, we’ll automatically map your post chat surveys to the Response object in Salesforce. To use managed mappings:

  1. From your survey, select  Mappings > Managed Mappings

  2. Install the managed package if you haven’t already.

  3. Turn on  the toggle to Sync to Salesforce using Managed Mappings.

  4. Select the button to Install GetFeedback for Salesforce Chat Package, then finish installing the package

Using Custom Mappings

Use custom mappings if you want to control where to store post-chat survey data. You don't need to install any packages if you use custom mappings.

To use custom mappings:

  1. From your survey, select Mappings > Salesforce Custom Mappings. Make sure you’re in your Draft survey.

  2. Select the Salesforce connection to use for draft and live survey results.

  3. Set up mappings for the object you want to send data to. Learn more about creating custom mappings

Tip: You can map the source of the survey so you know it came from a Salesforce Chat. Create a new field in your case or custom object called Case Type, or use an existing standard field like Case Source. Then, map a fixed value of Chat into that field every time a new survey response comes in from your post chat survey.

Redirecting to a Salesforce Case Survey

If an agent is not available to pick up a chat with an incoming request, you can set Salesforce Chat to time out after a certain amount of time or let the agent decline the chat. In either of these cases, you can then redirect the user to a GetFeedback Salesforce Case Survey that the customer can fill out to create a case in your help desk.

To show a survey after the chat disconnects: 

  1. Add either of the following merge fields to your survey link:

    • chat_disconnected_by

    • chat_start_time

  2. Take your survey once so we can record the merge fields you added. Once you submit your survey, you can use your merge fields in the survey logic.

  3. In your survey, add a logic rule before the first question.

  4. Create a rule based on the merge fields you added:

    • If chat_disconnected_by is equal to error, go to a custom exit page that redirects to your survey.

    • If chat_start_time is equal to blank, go to a custom exit page that redirects to your survey.

The image below shows an example of the logic rules:

kA61J0000005okfSAA_en_US_1_10

Privacy notice|California privacy notice
Terms of use
|Cookie policy

*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.