How to add reviews to a React site
Learn how to embed Trustmary's widgets to your React-based site (or similar).
Santeri
Last Update há 2 meses
How to find the code snippets
Widget code
Start by navigating to the Widgets section in Trustmary. In there, select a widget or create a new one.
Once in the widget editor, click the Add to website button. Here you'll find the first code snippet needed to embed the widget.
Click the copy button next to the code on the darker background to copy it.
Then take the widget ID (the string of characters in the URL) from the code you just copied...
...and paste it in place of the asterisks on this div-element:
The code can then be installed on your site on the spot where you would like the widget to appear.
Head script
Next you'll need to get the head script that loads the widgets on your site. Start by navigating to your account settings.
Under the Developers tab, you'll find the Trustmary tag script, which you can copy by clicking the Copy button on the right.
You can also get to this view by clicking the API & Webhooks in the navigation bar while on the Dashboard.
Once you've copied the script from the settings, install it to the head element on your website.
When both of the code snippets are installed correctly in their respective places, the widget should be displayed, and your reviews should be online.