Simplesat can be embedded to show an in-app survey at the end of a Salesforce messaging conversation.
Here's an example of what this looks like:
To set this up you'll need to configure a couple things.
Configuring your webpage
We recommend that the chat widget has a height of at least 600px. This can be achieved by adding the following css to the page where the widget is embedded:
<style>
/* Resize the chat window iframe */
iframe[id^="embeddedMessagingFrame"] {
width: 400px !important;
height: 600px !important;
max-width: none !important;
max-height: none !important;
bottom: 20px !important;
right: 20px !important;
}
</style>
Smaller chat frames are possible, but would require custom CSS in Simplesat to scale down the survey.
Besides that, the widget also needs to have the following setting configured inside the initEmbeddedMessaging function on your page:
embeddedservice_bootstrap.settings.omitSandbox = true;
Configuring Salesforce
In Salesforce, go to setup > trusted urls
You'll need to add 2 new urls:
URL | CSP Directives |
connect-src (scripts) frame-src (iframe content) | |
connect-src (scripts) frame-src (iframe content) |
Setting up the survey component
In Simplesat, either create a new Salesforce survey or use an existing one. Then copy the survey link.
In Salesforce, go to setup > messaging components.
Create a new messaging component of type auto response.
Fill in a default message and component name and click done.
Click add format and add a web page.
Make sure the web page is prioritized by moving it to the top.
Next, go to constants and create a new custom constant.
Name it survey_url
and and click save, then click edit.
Paste your copied survey link in the value, but remove {{{Case.Id}}} and everything after from the survey url, it should end up looking somewhat like this:
https://api.simplesat.io/api/rating/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
Next go to component formats > text.
In the formula template, paste this:
{!$Constants.Title}
{!$Constants.survey_url}{!$Parameters.MessagingSession.SessionKey}
Click save and go to component formats > web page
Under message configuration set the type to constant and the constant to $Constants.Title
Under URL configuration set the type to formula and add this in the formula field:
$Constants.survey_url + SessionKey
Under display configuration select popup message as the display method.
Click save and activate your component.
Next go back to Salesforce's setup and go to messaging settings.
Click on the channel on which you'd like to send a survey, scroll down to automated responses and select your survey component at end conversation.
Try it out!
Create a test conversation with yourself. Close the conversation and click any rating that you like. Once you do, new feedback should instantly show up in your Simplesat dashboard. 🎊
If you run into any issues let us know and we'll be happy to help troubleshoot. 🙌