DisplayEmbed guides

Embed a widget on Shopify

Add your widget to your Shopify store with a Custom Liquid section in the theme editor, on your home page, product pages or every page.

Shopify shows a ReTestimonial widget through a Custom Liquid section, which you add to your theme in Shopify's theme editor. You copy the widget's code once, paste it into the section and save. There's no Shopify app to install.

These steps are for themes with sections on every page, which includes every theme in the Shopify Theme Store today. On an older theme, see On a vintage theme.

Copy your widget's embed code

In the widget builder, click Get code. Click Publish and copy code, or Copy code if the widget is already published. If you haven't made a widget yet, start with Embed a widget on any website.

The Embed code dialog for a published widget, showing the snippet to copy

Open the page in the theme editor

In your Shopify admin, go to Online Store > Themes, find your theme and click Edit theme (Customize on some screens). The editor opens on your home page. For another page, pick its template from the Home page menu at the top, such as Products > Default product for your product pages.

Add a Custom Liquid section

In the sidebar, click Add section, search for "Custom Liquid" and select it. Drag the new section by its handle to the spot where the widget belongs.

Paste the code and save

Click the section and paste the code into its code box in the sidebar. Paste all of it without changing it, down to the closing </script> tag. Then click Save. On your live theme, Shopify may ask you to click Publish to make the change live.

The editor's preview draws the widget a moment after you add the section. Open your store to check how it looks to visitors.

Good to know

  • A template covers every page that uses it. A widget added to Default product shows on all your product pages. To show it on some products only, create a new product template in Shopify, add the section there and assign that template to those products.
  • Use the footer for every page. Your header and footer are shared by all pages, so a Custom Liquid section added to the sidebar's footer area appears everywhere. That suits floating widgets: Floating Proof widgets, the Floating Proof Tab badge and the Video type's Floating CTA style attach to the browser window, not to the section.
  • Change the design in ReTestimonial. Your theme's CSS can't restyle the widget. Only its text follows your theme's font, until you choose a font in the builder. See Widget looks different on your website. Once the widget is published, your edits in the builder reach your store with the same code. The exception is switching to a floating style: Get code then gives you new code to replace the old.
  • Several widgets can share a page. Give each one its own section.
  • No Custom Liquid section? Not every theme offers one. Check your theme's documentation, or ask its developer, for a way to add custom HTML.
  • A Wall of Love works the same way. Click Embed code… on its card, choose Shopify, click Copy and follow these steps. See Embed a Wall of Love on your website.

One widget for every product page

To show each product's own testimonials without a template for each product, put one widget on Default product and let Proof Match choose its testimonials by the page's address. Proof Match is on Premium and Business.

  1. Tag each testimonial with its product, such as linen-apron. A form can tag everything it collects. See Tag testimonials as they arrive.
  2. Turn on Proof Match. In the widget builder's Content tab, click Proof Match under Selection Mode. Its base pool is what a product page without a rule shows, such as your best testimonials of any product.
  3. Add a rule for each product. Shopify shows a product at /products/ followed by its handle, so on the rule's Context tab, set Path patterns to /products/linen-apron*. On its Proof tab, click Override a stage, choose Tags and pick that product's tag.
  4. Add the widget to Default product with the steps at the top of this page.

A rule that finds fewer than three testimonials shows the base pool instead, unless you choose Show nothing on its Fallback tab, so a new product never shows an empty widget. Rules are checked from the top and the first match wins. A * also matches a longer handle, so put the rule for /products/linen-apron-set* above the one for /products/linen-apron*. If your theme opens products from a collection at an address such as /collections/aprons/products/linen-apron, start the pattern with a * too: */products/linen-apron*. A widget holds up to 20 rules, so give your best sellers a rule each and let the other products show the base pool. See Set up Proof Match rules.

On a vintage theme

If no Add section button appears below your product template's sections, your store uses a vintage theme, which can't take sections on its other pages. To place the widget there, the code has to go into your theme's code through Edit code. Do this only if you know HTML, or ask your theme's developer.

Next steps

Was this page helpful?

On this page