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-widget="your-widget-id"></script>data-widget 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 — it will never block your page from rendering.
<script src="https://cdn.feedbackbar.io/widget.js" data-widget='["wgt_homepage", "wgt_blog"]'></script>FeedbackBar automatically shows only the most specific match for the current page — see Page Targeting for details.
<!-- your page content --> <script src="https://cdn.feedbackbar.io/widget.js" data-widget="your-widget-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-widget="your-widget-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-widget value — it's your unique widget ID.