Install the feedback widget
Last updated:
How do I install the feedback widget?
To install the feedback widget, create a project, allow your domains and paste one script tag into your site. It works on any site where you can add HTML.
1. Create a project
In the dashboard, create a project and open its settings.
2. Allow your domains
Add each domain the widget will run on to Allowed domains. The server refuses reports from any other domain.
| Entry | Matches |
|---|---|
example.com | example.com and www.example.com, any port |
*.example.com | Any subdomain, such as staging.example.com, but not example.com |
localhost:3000 | Only that host and port |
3. Paste the script tag
Add this before </body>, or in the <head>:
<script src="https://commentpin.com/widget.js" data-project="YOUR_PROJECT_KEY" defer></script>
The project key is shown in the project settings. It is public, so it is safe in your HTML.
4. Send a test report
Open the site, click the feedback button, pick an element, mark up the screenshot and send. The report appears in the project inbox.
Session replay
On Pro (or a self-hosted install) you can turn on session replay in the project settings. Each report then includes a replay of the visitor's last 30 to 60 seconds on the page: page changes, clicks and scrolling. The recording stays in the visitor's browser until they send a report.
Every value typed into a form field is hidden. To leave out an element entirely, add data-commentpin-block to it. To hide the text inside an element, add data-commentpin-mask:
<div data-commentpin-block>Account balance: 1,204.00</div>
<p data-commentpin-mask>Signed in as jane@example.com</p>
Platform guides
Cannot add the script tag to a site? Use the browser extension or the bookmarklet.
Next: connect GitHub or Linear, or see configuration if you self-host.
Frequently asked questions
- Why does the feedback button not appear?
- The page's domain is not in the project's allowed domains, or the project key is wrong. The widget stays hidden on domains you have not allowed.
- How do I allow localhost?
- Add localhost with its port, for example localhost:3000. Entries with a port must match the port exactly.
- How do I allow all subdomains?
- Add *.example.com. It matches any subdomain but not example.com itself, so add both if you need both.
- Does the widget affect my site's styles?
- No. It renders inside a Shadow DOM, so your CSS and its CSS do not mix.
- How big is the widget?
- The build fails if the widget goes over 30 KB gzipped. The screenshot code loads only when someone starts a report.