The widget

A no-code feedback button you paste into your site in one line.

Install

#

The widget is a floating “Feedback” button that opens a message box on your site. It ships as one self-contained script — under 15 KB, loaded asynchronously so it never blocks your page, rendered in an isolated shadow root so it can't clash with your styles. Everything submitted flows into the same pipeline as the API.

Paste right before </body>
<script src="https://app.sentriment.com/widget.js" data-key="pk_live_…" async></script>

Three steps: create a widget key in Settings → API keys (it starts with pk_ and is safe to be public), add your domain under Settings → allowed origins, then paste the snippet. The Sources page shows a ready-made snippet with your key already filled in.

No-code platforms

ParameterInDescription
Webflowno-codeSite settings → Custom code → Footer code. Paste, publish.
WordPressno-codeA header/footer plugin (e.g. WPCode), paste into the footer — no theme editing.
Squarespaceno-codeSettings → Advanced → Code injection → Footer.
Framerno-codeSite settings → General → Custom code → End of <body> tag.
Shopifyno-codeOnline store → Themes → Edit code → theme.liquid, before </body>.

Identify the user

#

If a signed-in user leaves feedback, tell Sentriment who they are with data-user — their feedback then links to an end user for segments, health scoring, and GDPR.

html
<script src="https://app.sentriment.com/widget.js"
  data-key="pk_live_…"
  data-user="usr_123"
  data-email="dana@acme.com"
  async></script>

Tip

Add data-email if you plan to also connect Intercom or Zendesk — it's what lets Sentriment recognise the same person across your widget and your support inbox. Details in Identifying users.

Attach traits & metadata

#

All configuration lives on the script tag itself:

ParameterInDescription
data-useroptionalYour ID for the signed-in user.
data-emailneeds data-userThe user's email — enables cross-tool identity resolution. Traits attach to a user, so this only takes effect alongside data-user.
data-traitsneeds data-userJSON of user traits, e.g. {"plan":"pro"} — powers segment filters and Impact. Only takes effect alongside data-user; the widget logs a console warning if it is missing.
data-widgetoptionalNames this placement (e.g. "checkout") so you can compare widgets across pages.
data-metaoptionalJSON of extra properties attached to every item — shows up as chips in the Feed.
data-positionoptional"right" (default) or "left".

Allowed origins

#

A widget key only accepts submissions from the origins you list under Settings → allowed origins. This is what makes a public key safe to embed — someone copying it can't use it from their own site. Emails supplied through the widget are treated as untrusted (a browser can't attach feedback to a known user by guessing their email); server-side API calls are the trusted path for that.

An origin is scheme + domain + port — never a path. Browsers send exactly that in the Origin header, and we match it exactly, so these are four different entries:

text
https://acme.com        ← apex
https://www.acme.com    ← www is a SEPARATE origin
http://acme.com         ← http is a SEPARATE origin
http://localhost:3000   ← each port is its own origin

List whichever your pages actually load from. If your site answers on both the apex and www, add both — Settings offers a one-click shortcut for the missing one. Paths are ignored: pasting https://acme.com/pricing stores https://acme.com, which already covers every page on that origin.

Tip

Widget not sending anything? Open your site with the browser console visible — a blocked widget logs a [Sentriment] warning naming the exact origin to add. Blocked origins also show up in Settings → allowed origins with an Allow button.

Was this page helpful?