1
Open the widget
On your dashboard, click the review widget. The review widget builder opens.
2
Copy the widget code
Click Install Widget. In the Install Widget window, click Copy Code.
3
Paste the code into your website
Paste the code into your page at the place where you want the widget to show. Paste all the lines of the code. Most website builders have an HTML or embed block for this. See the guide for your website builder.
4
Check your widget
Open the page on your live site. If you still see the old page, reload it.
What the code contains
The code has these parts:<script src="https://snapwidget.com/js/snapwidget.js"></script>: this script sets the height of the widget, so the widget is as tall as its reviews.- An
<iframe>with the classsnapwidget-widget: this is the widget.
Put the widget in a box that has a width
The widget fills the width of the box that you put it in. The box must have a width. In a flex row, or in a box that shrinks to fit its content, the widget has no width to fill. Then the browser makes the widget 300 px wide. To fix this, give the box around the code a width. In a flex row, useflex: 1:
width: 100%:
React, Vue and Next.js pages
The widget also works on pages that add it after the page loads, for example pages made with React, Vue or Next.js. Load the scripts of the code once on the page, for example in the<head>. Then add the <iframe> where you want the widget. When your page adds the widget, snapwidget.js finds it and sets its height.