Web-embed surveys are an effective way to gather valuable customer feedback directly from your website or web app.
You can target specific customers or pages, and your web-embed survey script can even include customer or ticket attributes, allowing you to tailor your targeting rules and associate gathered feedback with specific attributes.
Let's dive into how you can install these surveys.
Configuring the embed script
Your embed script can be found in the "Publish" tab of your survey settings. While the default code comes with a few customer fields, it's easily customizable, and you can add ticket attributes for more comprehensive data collection.
Understanding ticket attributes
In Simplesat, we often use surveys to associate customer feedback with support tickets. We maintain this terminology for consistency with our dashboard reporting. However, in the context of web-embed surveys, you can think of a "ticket" as specific information associated with the page or section the customer is on.
If you choose to omit the ticket ID field, a random ID will be generated automatically. In most scenarios, it's advisable to leave out the ticket ID field. However, including it might be beneficial if you wish to link feedback to a specific order or booking ID.
Example of an embed script
Here's an example of how you could construct your embed script to gather both customer and ticket information:
<script id="simplesat-web-embed" src="https://cdn.simplesat.io/web-embed/web-embed-loader.js"></script>
<script>
window.addEventListener("load", function renderSurvey(event){
simplesat.survey({
survey_token: "[SURVEY_TOKEN]",
customer: {
email: "[email protected]",
name: "Tester McTestface",
company: "Test Inc.",
custom_attributes: {
plan: "Pro",
role: "Admin"
}
},
ticket: {
id: "1234",
custom_attributes: {
url: "https://www.simplesat.io",
page_title: "Simplesat Home"
}
},
})
})
</script>
Customizable Web-Embed Fields
You have the power to configure several fields within your web-embed survey. The following tables provide an overview of all configurable fields:
Customer
Field | Type | Description |
String | Email of the customer. | |
name | String | Name of the customer. |
company | String | The company the customer belongs to. |
custom_attributes | Object | An object containing as many fields as you wish. |
custom_attributes > field | String | A custom attribute field associated with the customer. |
Ticket
Field | Type | Description |
id | String | ID of the ticket. Omit this field for random ticket IDs to be generated and associated with feedback. |
subject | String | Subject of the ticket. |
custom_attributes | Object | An object containing as many fields as you wish. |
custom_attributes > field | String | A custom attribute field associated with the ticket. |
Using Dynamic Placeholders for Field Values
If you're embedding your survey in a web app or website that requires user login, you can use dynamic placeholders to fill in user-specific information. For instance, your app might have a field such as {{customer_email}}
which, when a logged-in user views the survey, would populate with that user's email.
This same principle can be applied to ticket fields, allowing you to capture dynamic information such as the current page URL, title, or any other relevant details.
Installing the survey
Incorporating a web-embed survey into your app or website is as straightforward as copying and pasting the provided embed code.
If you'd like the survey to be visible across all pages of your app or website, include the embed code in the global header of your website or app. The global header is a section of HTML code that gets loaded on every page. By placing the survey code here, you ensure it's included regardless of the specific page a user visits.
Targeting Specific Pages
Simplesat's survey settings provide visibility rules that you can use to target specific pages or sets of pages. You could, for example, set a rule that the survey only shows up on pages whose URLs contain a certain word or phrase.
Testing Your Survey
To test the appearance and functionality of your survey, Simplesat allows you to add a visibility rule that triggers the survey when a URL contains #test
. By appending #test
to the end of any URL, you can view and interact with the survey without it being visible to your general audience. For instance, if your website is www.example.com
, you could use www.example.com#test
to trigger the survey.