Survey widget installation

Use Featurebase surveys to collect feedback from your users and measure customer satisfaction.

Written By Robi Rohumaa

Last updated 2 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.

Featurebase's survey's.

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 // featurebaseJwt: generatedTokenValue // Authenticate user in the widget - should be skipped if using recommended SDK identification functionality }, (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 using our SDK identify functionality (recommended), 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 on your server and pass it to the initialize_survey_widget function as featurebaseJwt:generatedTokenValue.