Add the review widget on Shopify
Last updated
The Formgong Shopify app is not in the App Store yet, so on Shopify the widget goes into a Custom Liquid section of your product template. You do not need to edit theme code.
Add the widget to your product pages
- 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.
- In your Shopify admin, go to Online Store.
- Find your theme and click Edit theme.
- Click the Home page drop-down at the top of the theme editor and choose your product template.
- In the sidebar, click Add section, search for Custom Liquid and select it.
- Paste the Formgong code into the section's Liquid field, and add
data-product="{{ product.handle }}"to the div, as below. - Drag the section to where the reviews should go, for example under the product information, and click Save.
- Open a product page of your store. To check the code from Formgong, use step Check on the Widget tab.
<div data-formgong-reviews="fk_your_reviews_key" data-product="{{ product.handle }}" data-limit="6"></div>
<script src="https://formgong.com/reviews.js" defer></script>
Shopify fills in {{ product.handle }} with each product's handle, so every product page shows only its own reviews. The “Write a review” link on that page carries the same product, so new reviews land on it too.
Stars under product cards on collection pages need a change in your theme's code and are not covered here.
Common problems
There is no Custom Liquid in Add section
Not every theme has the section. If your theme supports custom blocks, open the Product information section, click Add block and pick Custom Liquid instead; Shopify uses the same route for its own Shop Promise badge. Otherwise ask your theme's developer to add the code to the product template.
Every product shows the same reviews
The div has no data-product. Add data-product="{{ product.handle }}" and save.
Reviews show on some products but not others
Those products use another product template. A product's template is set under Theme template on its page in Products. Add the Custom Liquid section to that template as well.
Imported reviews do not appear under their product
An imported review shows on the product whose handle matches its product. Exports from Judge.me and Shopify Product Reviews name products by handle already. For other files, put the handle in the product column; see Import and export reviews.
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.
Sources: Shopify: Sections and blocks, Shopify: Custom Liquid block on the product page, Shopify: Templates.
Related articles
Questions: support@formgong.com.