Use Featurebase surveys to collect feedback from your users and measure customer satisfaction.
Written By Robi Rohumaa
Last updated 3 months ago
👨💻 You'll need to write custom code for the setup process. If you're uncomfortable with this, share this guide with a technical team member who can assist.
Installing
The survey widget can be installed using our JavaScript SDK.
Example<!-- Importing the Featurebase SDK -->
<script>!(function(e,t){const a="featurebase-sdk";function n(){if(!t.getElementById(a)){var e=t.createElement("script");(e.id=a),(e.src="https://do.featurebase.app/js/sdk.js"),t.getElementsByTagName("script")[0].parentNode.insertBefore(e,t.getElementsByTagName("script")[0])}}"function"!=typeof e.Featurebase&&(e.Featurebase=function(){(e.Featurebase.q=e.Featurebase.q||[]).push(arguments)}),"complete"===t.readyState||"interactive"===t.readyState?n():t.addEventListener("DOMContentLoaded",n)})(window,document);</script>
<script>
Featurebase(
"initialize_survey_widget",
{
organization: "yourorg", // Replace this with your organization name, copy-paste the subdomain part from your Featurebase workspace url (e.g. https://*yourorg*.featurebase.app)
placement: "bottom-right", // optional (bottom-right or bottom-left)
theme: "light", // optional (light or dark)
email: "youruser@example.com", // optional
locale: "en", // Change the language, view all available languages from https://help.featurebase.app/en/articles/8879098-using-featurebase-in-my-language
// jwtToken: "token", // optional - add additional user data
},
(err) => {
// Callback function. Called when identify completed.
if (err) {
// console.error(err);
} else {
// console.log("Data sent successfully!");
}
}
);
</script>
Triggering the survey
After the widget is installed, each survey will trigger automatically based on the settings you have configured in the Featurebase dashboard.
Adding user data
If you are already using our SDK identify functionality, then all the data about the user will be automatically connected to the Survey widget as well.
As an additional option, you could generate a JWT token on your server and pass it to the initialize_survey_widget
function.