How to show recently viewed products in Shopify (step-by-step guide)
Recently viewed products keep shoppers engaged and lift average order value. Here is exactly how to add this feature to your Shopify store.
Recently viewed products is one of the highest-ROI features you can add to a Shopify store for clothing brands. Here is how to implement it correctly.
The feature works by storing product IDs in the browser's localStorage as the visitor browses your store. On product and collection pages, a section reads this stored list and renders the corresponding products using the Shopify Storefront API or a simple AJAX call to the product JSON endpoint.
Option 1 — Native theme implementation: If your theme is a Shopify 2.0 theme (Dawn or similar), you can add a custom section that reads from localStorage and renders product cards. This requires about 60–100 lines of JavaScript and a Liquid section file. No app needed.
Option 2 — App: If you are not comfortable with custom code, apps like 'Also Bought' or 'LimeSpot' include recently viewed as a feature. Be aware that most recommendation apps inject additional JavaScript, which adds page weight.
For maximum impact, place the recently viewed section in two locations: the product page (below the main product content) and the cart page (as a 'before you check out' section). The cart page placement is particularly effective for fashion brands with browseable catalogues.
One common mistake: displaying recently viewed products that are out of stock. Make sure your implementation checks stock status before rendering a product in the section. An out-of-stock product in the recently viewed section creates a dead end.
Need help?
Want us to implement this for your store?
We build, optimise and grow Shopify stores for fashion brands. Get a free audit and see exactly what we would change on your store.
Get a free store audit