Appearance
Install Ybug on Netlify
Add the Ybug widget to collect visual feedback on live sites and Deploy Previews. Reporters can send annotated screenshots from the page without signing in to Ybug.
Open your project in the Ybug dashboard, go to Widget configuration and copy the widget snippet. Keep the <script> tags when you paste it.
Add the widget to static pages
- Open your project in Netlify and go to Project configuration → Developer settings → Post processing.
- Under Snippet Injection, select Add Snippet.
- Name it
Ybug, choose to inject before the closing</body>tag, and paste the snippet. - Select Save. Netlify applies the snippet when it serves the page, so you can test it right away.
Open the site on its netlify.app address or custom domain. Send a test report with the feedback button and check that it appears in your Ybug project.
Show the widget only on Deploy Previews
Wrap your full Ybug snippet in a Liquid condition in the same Netlify snippet editor. Replace the HTML comment with the snippet you copied from Ybug.
html
{% if CONTEXT == 'deploy-preview' %}
<!-- Paste your full Ybug snippet here. -->
{% endif %}Open a Deploy Preview and check that the widget appears. Then open the production URL and check that the widget is hidden. Reports include the exact preview URL.
Install in your app layout for server-rendered pages
Netlify Snippet Injection applies to static HTML. For server-rendered and function-served pages, add the snippet to your app’s shared layout before </body>. For proxied pages, add it to the HTML returned by the upstream app. If your project serves both static and server-rendered pages, place the snippet in their shared layout so it loads once per page. Don't also add it through Snippet Injection, or static pages will load the widget twice.
To show the widget only in previews, set a Netlify environment variable such as YBUG_ENABLED=true for the Deploy Previews context. Render the snippet in your layout only when that variable is true, then redeploy and test both URLs.
For React, Vue or Angular, see the framework installation options.
See also
- Netlify Snippet Injection documentation
- Configure Content Security Policy for Ybug if your site restricts scripts or requests.
- Ybug for Netlify sites and Deploy Previews