When you choose Copy code, you get two things: a box with the class trustsays-widget and your settings, and a script loaded from https://api.trustsays.com/widget/v1.js. The box goes where the widget should be shown. The script only needs to be there once per page, even with several widgets.
The most important attributes
- data-company: your domain, e.g. company.com. Without it, nothing is shown.
- data-variant: which widget, e.g. mini, carousel or w05. An unknown name gives no widget.
- data-lang: the language in the widget, e.g. da, en, sv or de. See below.
Appearance
- Colours: data-accent, data-bg, data-text, data-muted, data-border, data-surface and data-empty-star. Written as # and six characters, e.g. #0E8A5F.
- Shape: data-border-width (0 to 4), data-radius (0 to 24) and data-scale (70 to 130).
- data-shadow: none, soft or hard. data-stars: sharp, soft or round.
- data-font: orig, figtree, system, serif or mono.
- data-logo: true or false. Only works on paid plans. On Free the logo is always included.
- data-score-colors: true gives star colour by score, false gives your own colour.
- Texts: data-text-excellent, data-text-microA, data-text-seeAll, data-text-seeReviews and data-text-collectQ. No more than 120 characters.
An invalid value, e.g. a colour in the wrong format, just gives the default. The widget doesn't break.
Extras for some widgets
- Product stars: data-product-name and data-product-price. Product card also uses data-product-image.
- Hero overlay: data-image with your image.
- Signatures: data-name, data-role and data-phone.
Images must be addresses starting with https://.
Language
Widget studio creates code in Danish or English. The widgets' texts are also available in Swedish (sv), Norwegian (nb), Finnish (fi), German (de), French (fr), Dutch (nl), Italian (it), Spanish (es), Portuguese (pt), Polish (pl) and Japanese (ja). Change data-lang to the code you want. Other languages become English.
If you remove data-lang completely, the widget follows the page's own language, and otherwise the browser's. That's handy on a site with several languages. Reviews are always shown in the language they were written in.
Older code, where everything is in one script tag, still works.