3 min read
Embedding FeedbackBar takes one snippet of code and about two minutes. This article walks you through getting the snippet from your dashboard, choosing the right embed mode, and adding it to any type of site.
The embed code panel has two tabs. Choose before you copy. The snippet is different for each.
<script src="https://cdn.feedbackbar.io/widget.js" data-project="your-project-id"></script>data-project attribute.Use this for 95% of cases.
<script>
window.FeedbackBarConfig = {
widgetId: "your-widget-id",
theme: { primaryColor: "#007244", borderRadius: 8 },
position: { placement: "bottom-right", offsetX: 20, offsetY: 20 },
text: {
question: "Was this helpful?",
positivePrompt: "What did you like?",
negativePrompt: "What could we improve?",
thankYouMessage: "Thank you!"
},
behavior: { showAfterSeconds: 5, hideAfterDismiss: true }
};
</script>
<script src="https://cdn.feedbackbar.io/widget.js"></script>Add the snippet just before the closing </body> tag on every page where you want the widget to appear. The widget loads asynchronously and will never block your page from rendering.
data-project snippet above handles it automatically. FeedbackBar shows the most specific match for the current page.Prefer explicit control? List widget IDs directly:
<script src="https://cdn.feedbackbar.io/widget.js" data-widget="wgt_homepage, wgt_blog"></script>See Page Targeting for details.
<!-- your page content --> <script src="https://cdn.feedbackbar.io/widget.js" data-project="your-project-id"></script> </body> </html>
Go to Appearance → Theme File Editor → footer.php (or use a plugin like Insert Headers and Footers) and paste the snippet before </body>.
Alternatively, paste it in Appearance → Customize → Additional CSS, but note that CSS injection won't work for scripts. Use the footer.php method or a dedicated plugin.
Add the script to your root layout or _document.tsx:
// app/layout.tsx (Next.js App Router)
import Script from 'next/script';
export default function RootLayout({ children }) {
return (
<html>
<body>
{children}
<Script
src="https://cdn.feedbackbar.io/widget.js"
data-project="your-project-id"
strategy="lazyOnload"
/>
</body>
</html>
);
}Use strategy="lazyOnload" to ensure the widget doesn't affect your Core Web Vitals score.
Go to Online Store → Themes → Edit code → Layout → theme.liquid and paste the snippet just before </body>.
Create a new tag: Custom HTML. Paste the snippet. Set the trigger to All Pages (or a specific page trigger). Publish the container.
If the widget doesn't appear, see Widget not appearing on my site.
If you're not the one adding the code, share this page with your developer along with the snippet from your dashboard. The only thing they need to know:
</body> on every page.data-project value. It's your unique project ID.FeedbackBar supports three embed approaches. They all work, and you can mix them across pages.
| Strategy | Best for | Snippet |
|---|---|---|
| Project-level | Most users. Embed once, manage everything from the dashboard. Never update code when you add widgets. | data-project="proj_abc" |
| Per-widget (comma-separated) | SPAs or static sites where you want explicit control over which widgets are active. | data-widget="wgt_a, wgt_b" |
| Single widget | CMS templates (WordPress, Shopify) where each template has its own widget. | data-widget="wgt_abc" |
You can combine any embed strategy with window.FeedbackBarConfig to override settings on specific pages. The config block must appear before the widget script tag.
Set widgetId to target overrides at one widget only. Other widgets on the page are unaffected.
<script>
window.FeedbackBarConfig = {
widgetId: "wgt_pricing",
text: {
question: "Finding what you need?",
negativePrompt: "What's unclear about our pricing?"
}
};
</script>
<script src="https://cdn.feedbackbar.io/widget.js" data-project="your-project-id"></script>Omit widgetId to apply overrides to whatever widget the server resolves for the current page.
<script>
window.FeedbackBarConfig = {
text: { question: "Quick question before you go:" },
behavior: { showAfterSeconds: 30 }
};
</script>
<script src="https://cdn.feedbackbar.io/widget.js" data-project="your-project-id"></script>FeedbackBarConfig overrides on top. Only the properties you specify are changed — everything else uses your dashboard settings.