SnagFrog
Compare Privacy Terms Sign in

How to add a bug report button to your website

Last updated 2 October 2026

The short answer: add one script tag. It puts a small "Report a bug" button on your pages that opens a form and attaches the page, browser and recent console errors for the user. This guide covers setup, telling reports apart by user, and replying.

What makes a website bug report useful?

  • The page URL where it happened.
  • Browser, OS and window size, since many web bugs only show up in one of them.
  • Recent console errors, which the user can't see but usually point at the cause.
  • Who the user is, if they're signed in.
  • A way to reply, so you can ask for steps or tell them it's fixed.

Step 1: Create an app in SnagFrog

Sign up (14-day trial, no card) and create an app for your site. Its Install tab has a widget configurator with a live preview.

Step 2: Paste the script tag

Add this before </body>, with your app's slug:

<script src="https://snagfrog.com/widget.js" data-app="your-app" async></script>

Options are data- attributes: color, label, left or right position, light or dark theme, a keyboard shortcut, and whether to capture console errors or the full page URL. The configurator writes them for you.

Step 3: Identify users and add context

// Who is reporting (after sign-in):
Snag.identify({ email: user.email, name: user.name });

// Extra details attached to every report:
Snag.setContext({ plan: "pro", build: "2026.10.2" });

// Open the form from your own menu item:
Snag.open();

Step 4: Send a test report and reply

Click the button and send a report. It shows up in your inbox with the page and browser details. If the reporter left an email, your reply reaches them by email and their answer threads back into the same report.

Questions

How do I add a bug report button to my website?

Paste one script tag before </body>. The SnagFrog widget adds a floating "Report a bug" button that opens a short form and attaches the page URL, browser details and recent console errors to the report.

Does it work with React, Svelte, Vue or a static site?

Yes. It is a plain script tag with no dependencies, so it works on static sites, server-rendered pages and single-page apps alike. In a SPA, call Snag.open() from your own button if you hide the default one.

Can I pass the signed-in user so I know who reported the bug?

Yes. Call Snag.identify({ email, name }) after sign-in. Add app state with Snag.setContext({ plan: "pro" }); it is attached to every report.

Does it work with a Content-Security-Policy?

Yes. The widget uses no inline scripts or eval. Allow snagfrog.com in script-src and frame-src.

Start a free 14-day trial · Compare with other tools

SnagFrog by Karakabakov Privacy · Terms