Guides

How to add a feedback widget to a Astro site

Where the Bopmigo line goes in a Astro site (your base layout, for example src/layouts/Layout.astro), with code you can copy, and how to test it locally.

Short answer: add your Bopmigo line with is:inline to the base layout every page uses, just before </body>. Build and deploy.

A changelog page with the Bopmigo Feedback window open
Requests arrive with the page they were sent from.
A resolved report in the Bopmigo inbox with its summary
Every report starts with what happened and what they expected.

Add it to Astro

  1. 1

    Create your Bopmigo project

    Sign up at bopmigo.com, choose Website, and add your Astro address. Copy your line from Install snippet:

    HTML
    <script src="https://bopmigo.com/widget.js"
      data-project="YOUR-PROJECT-ID" defer></script>
  2. 2

    Open it

    Open the layout your pages share.

  3. 3

    Add your line

    Add the line before </body>, with is:inline so Astro leaves it as it is.

    Astro
    ---
    // src/layouts/Layout.astro
    ---
    <html lang="en">
      <body>
        <slot />
        <script is:inline src="https://bopmigo.com/widget.js"
          data-project="YOUR-PROJECT-ID" defer></script>
      </body>
    </html>
  4. 4

    Go live

    Build and deploy.

  5. 5

    Send yourself a test

    Open the live page, choose Feedback and send a short report. It arrives in your Bopmigo inbox (and by email, if you turned that on). Reply, then open Feedback again to see your answer.

Astro tips

  • Without is:inline, Astro may try to process the script. The attribute keeps it exactly as written.
  • If you use ClientRouter or view transitions, test a page change and Back navigation. Inline scripts can run again after navigation; check for exactly one Feedback button.
  • Static and server output both work: it runs in the browser.

Single-page apps and client-side routing

Load the script once in the root layout, not per page. Bopmigo notes the page people are on when they report, including after client-side navigation, so there’s nothing to re-run on route changes.

Testing locally

Add your local address (for example http://localhost:3000) to the project in Bopmigo, alongside your production address. Reports are only accepted from addresses you list.

What Astro users tend to report

  • Islands that don’t hydrate on slow phones.
  • Broken links after a content migration.
  • Docs pages readers can’t find answers on.
Three phones showing New reply on the button, the feedback list and the conversation
Replies reach people where they reported, on any screen size.

Your first week

  1. 1

    Day 1: test locally and in production

    Send a report from localhost and from your live site, and check both arrive in the same inbox.

  2. 2

    Days 2 to 5: identify signed-in users

    Pass the user ID and any useful context, such as plan or account, so each report says who it came from.

  3. 3

    Days 6 and 7: route reports to your tracker

    Copy reports that need code changes into your issue tracker, and reply when the fix ships.

Questions

Does it affect my Lighthouse score?

It loads with defer, after your page has been parsed, so it doesn’t block your page from showing.

Do I need a React integration?

No. It’s a plain script; no framework integration needed.

Why doesn’t the button show?

Check that the address you’re on is listed in your Bopmigo project, that the change is live, and open a private window in case of caching. If your site has a Content Security Policy, allow https://bopmigo.com.

More: all install guides · website options · install with a coding agent