Add the review widget on an HTML page
Last updated
Any page you can edit as HTML takes the widget: a div where the reviews should appear and the script that fills it.
Add the widget
- In Formgong, open Reviews, pick your site, open the Widget tab, go to step Add to site and press Copy. No review site yet? Get started first.
- Paste the code into the page's HTML where the reviews should appear, for example before the footer.
- On a product page, add
data-productwith that product's id, as below. - Upload or deploy the page, then use step Check on the Widget tab with the page's address.
<div data-formgong-reviews="fk_your_reviews_key" data-product="linen-apron" data-limit="6"></div>
<script src="https://formgong.com/reviews.js" defer></script>
The widget follows <html lang>; data-lang overrides it. Every other setting is in The reviews widget.
Common problems
Nothing shows, and the browser console mentions a Content Security Policy
Allow https://formgong.com in script-src, connect-src, img-src and media-src. The widget styles itself with <style> elements inside its shadow DOM, so if your policy limits styles, add 'unsafe-inline' to style-src.
Every product shows the same reviews
Add data-product to the div on each product page. The “Write a review” link then carries the same product, so new reviews land on it.
The widget is in the wrong language
Set <html lang> on the page, or add data-lang to the div.
Only the “Write a review” link shows
The widget shows reviews only after you approve them. Open the site's Reviews tab and approve the ones under Waiting. On a product page, the product also needs approved reviews of its own.
Related articles
Questions: support@formgong.com.