Widgets
How to add popups and widgets to Shopify
Add popups, a free shipping bar, coupon windows and Google reviews to your Shopify store with one line in theme.liquid. A step-by-step setup guide.
In short
- You don't need a separate app for every tool to add popups or widgets to Shopify: you build the widget in Roigo and paste the one-line code once into your theme's theme.liquid file, right above
</body>. - Once the code is in, every later widget is published from the panel; when the code is running, the panel shows “Verified”.
- The free shipping bar reads the Shopify cart from
/cart.js: it uses the total after discounts and updates without a page reload as items change. It works with carts in Turkish lira. - Because the code lives in your theme file, if you switch to or publish a new theme you need to add the line to that theme too.
In this guide
When you want a campaign bar, a first-order discount popup or Google reviews on Shopify, the first idea is usually a separate App Store app for each. That works, but every app means another dashboard, another set of settings and often another fee. This guide covers a different route: building all your widgets in one place and adding them to your theme with a single line of code.
Below you'll find the steps for adding widgets to Shopify with Roigo, the Shopify-specific behaviour (cart reading, page types, checkout) and what to watch for when you change themes. For general popup rules, see how to add a popup to a website.
How do you add a popup or widget to Shopify?
The short answer: build the widget, paste the install code right above </body> in theme.liquid, then publish. The steps:
- Open Widget Studio in Roigo, pick a template on the Templates tab and adjust the copy, colours and button link to your store.
- Copy the install code from the panel. It's a single line shaped like
<script async src="…/w.js" data-site="…"></script>and is specific to your store. - In your Shopify admin, open Online Store → Themes → ⋯ → Edit code.
- Open theme.liquid in the Layout folder, find
</body>with Ctrl + F, paste the code right above it and save. - Open your store once. When the code is running, the panel shows Verified.
- Click Publish in Widget Studio. For later widgets you don't need to repeat steps 2–4.
Which widget does what on Shopify?
Most widgets work regardless of platform; the ones that read the cart or find the “Add to cart” button also recognise Shopify specifically.
| Widget | What it does | On Shopify |
|---|---|---|
| Free shipping bar | Shows how far the cart is from the threshold as it changes. | Reads the cart from /cart.js and uses the total after discounts; Turkish lira carts only. |
| Ships today on product pages | An “Order within 2 hours and it ships today” line. | Places itself under the “Add to cart” button. |
| Welcome coupon, email capture, prize wheel | First-order discounts and subscriber capture. | You create the code in Shopify's Discounts section first. |
| Google reviews | Shows your Google business reviews inside the page. | Sits right above the footer by default. |
| Announcement bar, countdown, trust badges | Campaigns, end times, shipping and returns promises. | Pick one so it doesn't stack on top of your theme's own announcement bar. |
Live preview: try it
Page types and targeting on Shopify
On the targeting tab you choose to show the widget on all pages, the home page, product pages, category (collection) pages, the cart, or pages whose address contains a given piece. On Shopify these page types are recognised from the address and the page's own markup:
- Product:
/products/addresses and pages marked up as a product. - Category:
/collections/addresses. - Cart and checkout:
/cartand the checkout steps. Only widgets targeted there and corner buttons appear on these pages; the free shipping bar also shows on the cart itself, but not in checkout. - Languages and markets: if your store uses a language prefix such as
/en/, cart reading takes that prefix into account.
What happens when you change themes?
The code lives in your theme's theme.liquid file. When you upload and publish a new theme, or switch to a different version of a theme, that theme brings its own theme.liquid; you need to add the code there too. Your widgets and settings stay in the panel, so you don't rebuild anything.
- Before publishing the new theme, add the same line to its theme.liquid via Edit code.
- After publishing, open your store once and check the Verified status in the panel.
- Make sure the code works in the new theme before deleting the old one.
If a widget doesn't show on Shopify
- Is the code in the live theme? If you added it to a draft theme, it won't run in your live store.
- Is the widget published? A widget you haven't published shows only in the preview.
- Is the targeting right? A widget aimed at product pages won't appear on the home page; check the device setting too.
- Frequency: if you closed a widget set to “Once a day” or “Only once”, you won't see it again in that browser; try a private window.
- Free shipping bar: if the store currency isn't Turkish lira, the bar doesn't read the cart and doesn't appear.
Does a popup affect your Shopify store's SEO?
Google says popups that cover the main content as soon as someone lands, and are hard to dismiss, hurt the experience, especially on mobile, and can lower search performance (Google). Legally required dialogs (such as cookie consent) and bars or cards that use a reasonable amount of screen space don't count. On mobile, choose a bar or corner card, or a popup that opens after a few seconds. The details are in the mobile popup guide.
Pre-launch checklist
Plans and limits
On the trial you build and preview widgets; publishing in your store starts with Lite: 3 live widgets and 25,000 views a month. Higher plans include more; see Pricing for details.
Frequently asked questions
Do I need to install an app to add a popup to Shopify?
Roigo widgets don't need an App Store app: you add a one-line code to your theme's theme.liquid once, and all widgets run through it.
Where in theme.liquid should the code go?
Right above the `</body>` tag. Open theme.liquid in the **Layout** folder via **Online Store → Themes → ⋯ → Edit code** and find it with **Ctrl + F**.
Does the free shipping bar on Shopify account for discount codes?
Yes; the bar reads the cart from Shopify's `/cart.js` response and uses the total after discounts. Your store currency needs to be Turkish lira.
Do widgets show on the Shopify checkout?
No. On the cart page only widgets targeted there, corner buttons and the free shipping bar appear; no widgets are shown in the checkout steps.
Sources
The official documents the information in this guide is based on.
Add widgets to your Shopify store from one place
Coupon popups, shipping bars, Google reviews: all in one panel, with a single line in theme.liquid.
Get startedNo card required · 3 live widgets on Lite
Related guides
All guidesWidgets
How to add popups and widgets to ideasoft
· 13 min readWidgets
How to add popups, widgets and scripts to ikas
· 13 min readWidgets
How a free shipping bar raises your average order value
· 6 min readWidgets
Adding a popup to your website: types, rules, setup
· 13 min readProduct SEO
Shopify product page SEO checklist: 12 points
· 5 min readWidgets
What is an e-commerce widget? Tools that help sales
· 5 min read
