Integrations
App & Website Surveys
Embed SurveyTale surveys in your website or product.
App & Website Surveys
In-product (app) surveys appear inside your website or web app as a pop-up, triggered by user behavior. They are powered by the SurveyTale SDK.
Prerequisites
- A SurveyTale workspace.
- Access to add a script to your website's
<head>, or a bundler for the npm package.
Option 1: HTML embed (script tag)
Add this snippet to the <head> of your site. Replace workspaceId with your
workspace ID (found in Workspace Settings):
<script type="text/javascript">
!function(){
var appUrl = "https://app.surveytale.com";
var workspaceId = "<your-workspace-id>";
var t=document.createElement("script");
t.type="text/javascript";t.async=!0;
t.src=appUrl+"/js/surveytale.umd.cjs";
t.onload=function(){
window.surveytale && window.surveytale.setup({ workspaceId: workspaceId, appUrl: appUrl });
};
var e=document.getElementsByTagName("script")[0];
e.parentNode.insertBefore(t,e);
}();
</script>The SDK exposes a global window.surveytale with methods including setup,
track, setEmail, setAttribute, setUserId, and logout.
Option 2: npm package
For framework apps, install the SDK and initialize it in your app entry point:
npm install @formbricks/jsimport formbricks from "@formbricks/js";
formbricks.setup({
workspaceId: "<your-workspace-id>",
appUrl: "https://app.surveytale.com",
});Triggering surveys
In SurveyTale, create an app survey and set its display criteria — for
example, on page load, on a code action you fire with surveytale.track("..."),
or on scroll. The survey appears to users who match the criteria.
Notes and troubleshooting
- Confirm
https://app.surveytale.com/js/surveytale.umd.cjsloads (status 200). - Open your browser console to see SDK connection status.
- The survey only appears once its display criteria are met and the workspace environment has synced.