# Recently viewed

> Show the products a visitor opened last, on any page, from their browser or, for logged-in customers, from their account.

Status: Ready (Smootify 2.0)  
Add-on: Last Viewed  
1.x page: https://docs.smootify.io/docs/ecommerce/add-ons/last-viewed  
URL: https://www.smootify.io/docs/features/last-viewed  
Updated: 2026-10-01

Recently viewed products help a visitor go back to what they looked at. Smootify records each product page the visitor opens and gives you a card template to list those products anywhere: on the home page, in the cart, under a product. There is nothing to record by hand.

> [!NOTE]
> Turn on **Last Viewed** in the Smootify dashboard. It is free on every plan. On your `.webflow.io` address it works for testing before you turn it on, but only turning it on adds the customer metafield **Last Viewed** (`custom.last_viewed`, a list of products) to Shopify, where a logged-in customer's list is saved. In Shopify, under **Settings > Custom data > Customers**, check that this definition has **Customer accounts access** set to **Read and write**: Smootify creates it that way, but a definition that already existed keeps its own setting.

## What counts as viewed

- **A product page.** A product is recorded when the visitor opens its page: the template page of your Products collection, at the address your site uses for products (`products` by default, set by the `productsBase` option). A product seen in a card, a search result or the cart is not recorded.
- **The 10 most recent.** The newest comes first. Opening a product again moves it to the front. On a product page, that product is already first in the list.
- **Browser and account.** Every visitor’s list is kept in their browser. For a customer logged in with [customer accounts](https://www.smootify.io/docs/build/account), it is also saved in their account, and the account list is the one shown when there is one.

## Show the list

Add a Div block for the grid, and inside it a `smootify-product` with the custom attribute `data-id="last-viewed"`. Design it as one product card: Smootify copies it once per product, and the copies go next to it. Only the first `smootify-product` with `data-id="last-viewed"` on the page is used.

```html
<div condition="has-items-in-last-viewed">
  <h2>Recently viewed</h2>
  <div>
    <smootify-product data-id="last-viewed" limit="4">
      <a href="#" class="w-inline-block" product="link"><img variant="image"><div product="title">Product</div></a>
      <smootify-price><div data-prop="price">$0.00</div></smootify-price>
    </smootify-product>
  </div>
</div>
```

- **`limit`** sets how many cards show, 10 by default. Smootify keeps 10 products, so a higher number shows no more.
- Inside the card, everything a product card can show works: see [Product cards](https://www.smootify.io/docs/build/product-cards). Each card has the class `is-last-viewed-item`.

**Empty or not.** Two conditions work anywhere on the page, as around the heading above:

- **The list has products:** `condition="has-items-in-last-viewed"` shows while the list has at least one product. The body has the class `has-last-viewed` (on the body only, not on the card template).
- **The list is empty**, until the visitor opens a product page: `condition="no-items-in-last-viewed"` shows. The body has no `has-last-viewed`.

More in [the recently viewed cards](https://www.smootify.io/docs/reference/elements/smootify-product-data-id-last-viewed).

## Before you publish

> [!STUCK]
> - **The list stays empty.** The product pages are not at the address Smootify expects. If your Products collection uses another URL, such as `product`, set `productsBase` in the [Smootify options](https://www.smootify.io/docs/reference/options).
> - **Nothing is recorded on the live site.** Last Viewed is not turned on in the Smootify dashboard.
> - **The list does not follow the customer to another device.** The customer is not logged in with customer accounts, or the **Last Viewed** metafield does not have **Read and write** customer accounts access in Shopify.
> - **Never more than 10 cards.** Smootify keeps the 10 most recent products, whatever the `limit`.
