On this page
If you have access to the page's HTML yourselves, or you use a system other than the ones we have guides for, here's how to do it.
How to do it
- Copy the code in Widget studio with Copy code.
- Put the box with the class trustsays-widget where the widget should be shown on the page.
- Put the script on the page once, ideally at the bottom just before the closing body tag.
- Save, and open the page in the browser.
The script loads with async, so it doesn't wait for or slow down the rest of the page.
Several widgets on the same page
Copy the box for each widget you want. The script only needs to be there once. If it's there several times, nothing goes wrong, but it isn't necessary.
Pages built with JavaScript
If your site uses React, Vue or another framework where content changes without the whole page reloading, the script only finds the boxes that are there when the page opens. If you add a new widget later, call window.TrustSays.scan() afterwards. The new boxes are then drawn.
Placement
- Floating button, Floating tab and Latest review stay fixed in a corner of the screen, wherever the box is.
- Mobile bar stays fixed at the bottom and is only shown under 900 px.
- The other widgets fill the space the box gets on the page.
If it doesn't work
- Open the page from your real address, not as a file directly from your computer.
- Check that a Content-Security-Policy on your site allows scripts, data and fonts from api.trustsays.com.
- See The widget isn't showing.