Theme Stack Guide

How to Add Recently Viewed Products to a Shopify Store

October 17, 2026

Recently viewed products are stored in the shoppers own browser, not in their account, which makes the feature fast and private but also device specific. On Shopify you can add it three ways: a theme that includes the section natively, an app, or a small custom section that reads a cookie or local storage list and renders product cards. For most stores, a theme with the section built in or a lightweight app is the right call.

How recently viewed works under the hood

When a shopper opens a product page, a small script saves that products handle to the browsers local storage, keeping a short list of the last eight to twelve items. On any page with a recently viewed section, another script reads the list, fetches those products data, and builds cards in the same style as the rest of the theme. No account is needed and nothing leaves the device.

The tradeoffs follow from that design. The list does not follow the shopper from phone to laptop, it disappears if they clear browser data, and it should politely hide itself for first time visitors who have nothing stored yet. A well built section also excludes the product the shopper is currently viewing, so the row stays useful instead of redundant.

The three ways to add it on Shopify

Check your theme first. Many current themes include a recently viewed or recommended history section you can enable from the theme editor, often on the product page and cart page templates. That is the best option: it inherits your theme styling, adds no monthly fee, and updates with the theme.

If your theme lacks it, apps add the feature in minutes and usually include controls for list length, placement, and exclusions. Choose one that renders with your theme card design rather than its own widget look. The third route, a custom section built by a developer, makes sense when you need the row to behave exactly like your other product grids or to combine recently viewed with cart aware logic.

Where the section earns its place

The product page is the highest value placement: a shopper comparing three candles or two jackets can jump back without using the browser back button and losing their place. The cart page is second, where the row works as a gentle reminder rather than a hard upsell, and it can recover items a shopper viewed but never added.

Restraint matters. One row of four to eight products is helpful; stacking recently viewed, trending, and recommended rows on every page turns the store into a billboard. Place it where comparison shopping actually happens and leave the homepage to your curated merchandising.

Troubleshooting common problems

If the section shows stale prices or sold out items, the script is likely caching product data instead of fetching it fresh on each page load. Apps and native sections should pull live data; a custom build needs a fetch per stored handle. If cards look broken or unstyled, the section is rendering its own markup instead of reusing the themes product card snippet.

Test in a private window to see the empty state, then browse three products and confirm they appear in order on the fourth page. Also test on your phone: most of your traffic is mobile, and a row that overflows sideways or pushes the buy button off screen costs more than it earns.

Keep reading on this site: Index, Index, Index. Each of those pieces connects to the ideas above and gives more detail on the parts this guide could only summarize.

Frequently asked questions

Does recently viewed work for guests without accounts?

Yes. The feature runs entirely in the visitors browser using local storage or cookies, so it works for guests and logged in customers alike. The list is per device and per browser, which is the main limitation: it will not sync between a shoppers phone and their laptop.

Will a recently viewed section slow my store down?

A native theme section or a well built app adds very little weight, since it only fetches data for a handful of products the shopper already loaded once. Heavy apps that load large libraries on every page can slow things down, so check your speed after installing and remove anything that drags.

How many products should the row show?

Four to eight is the useful range. Fewer than four rarely helps a comparing shopper, and more than eight becomes a second catalog page. Most stores settle on the last six to eight viewed products, excluding the one currently on screen.

Should recently viewed appear on the homepage?

Usually not. On the homepage the shopper has either just arrived, so the list is empty, or is returning, in which case a dedicated continue shopping placement can work. Product and cart pages deliver most of the value with none of the clutter.