---
title: Feedback widget
description: One script tag adds a floating icon that opens a panel to ask a question, give feedback, report a problem or suggest an idea, with page context captured automatically.
---

The feedback widget is a form delivered as a floating icon in the corner of an app page. A click opens a small panel; the visitor picks an intent, writes a message and sends without leaving the page. It is the same intake pipeline as every other form, so it inherits domain verification, CAPTCHA, spam screening, delivery, the inbox and analytics. What it adds is structured context about where the visitor was and what they meant.

Sample: [`samples/js-embed/widget.html`](/samples/js-embed/README.md).

## The script tag

```html
<script src="https://api.contactusiq.com/f/au_xxxxxxx/widget.js"
  data-form="au_xxxxxxx"
  data-position="bottom-right"
  data-intents="question,feedback,problem"
  data-app-version="2026.09.1"
  async defer></script>
```

Put it in the shared layout so it is on every page, or only on the pages you want. `au_xxxxxxx` must be the id of a form whose kind is **feedback widget** (Dashboard, Forms, New, Feedback widget). `GET /f/{formPublicId}/widget.js` is cached at the edge and posts to the same `POST /s/{formPublicId}` endpoint with intent, rating and page context added.

## Data attributes

Any attribute you leave out falls back to the setting on the form, so the owner can change behaviour without a deploy.

| Attribute | Value | Purpose |
| --- | --- | --- |
| `data-form` | form public id | Which form to post to. Shown for clarity; the id is also in the script URL. |
| `data-position` | `bottom-right`, `bottom-left`, `inline` | Where the icon sits. `inline` means you render your own trigger (below). |
| `data-intents` | comma-separated subset of `question,feedback,problem,idea` | Which intents the panel offers. |
| `data-rating` | `none`, `thumbs`, `stars` | Rating control for the feedback intent. Thumbs-only is the "was this helpful?" mode, where the text field appears on thumbs down. |
| `data-app-version` | any string | Your release identifier. Reported with problems so a bug digest can group identical page and version pairs. |
| `data-user-id` | your user id | For signed-in users. Stored plain or hashed, per the form's identity setting. |
| `data-user-name` | display name | Pre-fills the panel so the visitor does not retype it. |
| `data-user-email` | email address | Pre-fills the panel. |

## Your own trigger

Set `data-position="inline"` and give any element `data-contactusiq-open`, optionally with `data-contactusiq-intent`, to open the panel from your own button:

```html
<button data-contactusiq-open data-contactusiq-intent="problem">Report a problem</button>
```

## Intents

| Intent | `_intent` value | What it is for |
| --- | --- | --- |
| Ask a question | `question` | Support questions. With suggested answers on (Pro), the panel searches the owner's registered docs URL as the visitor types and shows up to three articles before the send button; answered questions count as deflections. |
| Give feedback | `feedback` | Opinions and ratings. Offers the 1 to 5 or thumbs rating. |
| Report a problem | `problem` | Bug reports. Carries browser, OS, page and app version so reports group into a bug digest. |
| Suggest an idea | `idea` | Feature requests. |

Each intent has its own field preset and can have its own recipients, auto-reply and subject prefix. A client that is not the widget can send `_intent` and `_rating` as ordinary fields; see [Reserved fields](/api/intake#reserved-fields).

## Page context captured

Captured automatically and shown to the visitor before sending: page URL and title, referrer, viewport, browser and OS, locale, time on page, and the app version when `data-app-version` is set. The owner chooses which of these fields are captured and whether they are shown to the visitor.

In the inbox a widget submission shows its intent as a badge, the rating, and the page it came from, and can be filtered by any of them ("problems reported on /pricing this week"). Analytics gains a per-page view: submissions by page, rating trend per page, question deflection rate and problems by app version.

## Consent and privacy notes

- The widget sets no cookies of its own and loads deferred; it never blocks the host page if the script fails to load.
- Signed-in identity is only passed when the host sets the `data-user-*` attributes, and the owner chooses whether the user id is stored plain or hashed.
- Screenshots (later, Pro) are captured client-side only after the visitor agrees in the panel, stored as an attachment and never inlined in email.
- The panel carries the one-click privacy line naming the owner and ContactUsIQ and linking to both policies.
- Turnstile's own storage is strictly necessary for the challenge; see [Cookies and consent](/privacy#cookies-and-consent).

## Behaviour and quality bar

- Keyboard reachable, focus trapped in the panel while open, labelled for screen readers, honours reduced motion.
- Under 20 KB compressed.
- Offline: if the intake API is unreachable the panel queues the submission in local storage and retries when the page is next online, so a bug report about an outage is not lost to the outage.
- After sending: inline thank-you with the reference id, an optional "we usually reply within a day" line from the form settings, and an optional email confirmation to the visitor (Phase 2).

## Settings that live in the dashboard

These are set on the form's Widget tab, not in code:

| Setting | Options | Default |
| --- | --- | --- |
| Placement | bottom-right, bottom-left, inline trigger | bottom-right |
| Intents shown | any subset of question, feedback, problem, idea | question, feedback |
| Rating | none, thumbs, 1 to 5 stars | none for question, thumbs for feedback |
| Identity | ask name and email, use host-provided identity, anonymous allowed | ask |
| Context | which context fields to capture; whether to show them to the visitor | all, shown |
| Suggested answers | off, on with docs URL | off |
| Screenshot | off, on with consent prompt | off |
| Routing | recipients per intent | form's recipients |
| Appearance | accent colour, icon (chat, question, lightbulb, bug), label text, dark mode auto | chat icon, "Feedback" |

## Where it is used

ContactUsIQ's own dashboard shows the widget on every screen with the current screen name pre-filled as context, and this docs site is meant to run the "was this helpful?" mode on every article (it is switched on once the founder workspace's widget form exists).
