> For the complete documentation index, see [llms.txt](https://staylime.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://staylime.com/docs/avante-themes/sections/products/recently-viewed-products.md). Agents can also search and read this documentation through its [MCP server](https://staylime.com/docs/~gitbook/mcp).

# Recently viewed products

A row of the products this shopper has already opened, rebuilt from their own browser. No collection to maintain and nothing to curate.

Most people do not buy the first thing they open. They look at four or five, leave the page, come back, and then cannot find the one they liked. **Recently viewed products** puts that short list back in front of them — up to ten products they opened themselves, in a normal section you can place on the home page, a collection, the cart, or anywhere else.

It is the one product row in the theme that needs no setup at all: no collection to build, no products to pick. Every shopper sees a different row, and the row only exists because they built it.

{% hint style="info" %}
**Theme Editor → (any template) → Add section → Recently viewed products**
{% endhint %}

***

### How to add

{% stepper %}
{% step %}

#### Open the theme editor

In Shopify admin go to **Online Store → Themes** and press **Customize**.
{% endstep %}

{% step %}

#### Pick the page

Use the page selector at the top of the editor. The section works on any template — it is only blocked inside the header and footer section groups.
{% endstep %}

{% step %}

#### Add the section

Press **Add section** and choose **Recently viewed products** from the Products group.
{% endstep %}

{% step %}

#### Set the heading and the grid

**Heading** defaults to **Recently viewed**. Choose the desktop layout — three, four or five in a row, or a side heading with two or three products — and the mobile layout.
{% endstep %}
{% endstepper %}

***

### Good to know

* **The history lives in the shopper's browser**, under the key `avante-theme:recently-viewed`, and holds the **ten most recent products**. It is not attached to a customer account, so it does not follow the same person from phone to laptop, and clearing site data clears it.
* **The section is invisible until there is something to show.** A first-time visitor sees nothing at all — no heading, no empty row. This is also why the section looks blank in the theme editor: the editor preview has no browsing history behind it. Open a few products on the storefront preview and come back.
* **On a product page the current product is removed from the row.** The shopper does not get shown the thing they are already looking at.
* **The products load after the page does**, when the section scrolls into view, so it never slows down the first render.
* **It is not a recommendation engine.** Shopify's algorithm is not involved — the row is simply the shopper's own history. For algorithmic suggestions use [Product recommendations](https://staylime.com/docs/avante-themes/sections/products/product-recommendations.md) on a product template, or [Cart recommendations](https://staylime.com/docs/avante-themes/sections/products/cart-recommendations.md) in the cart.

***

### Customization ideas

* **On the cart page.** The things they looked at and did not add are the easiest second item in an order.
* **Low on the home page.** For a returning visitor it turns the home page back into where they left off, instead of a cold start.
* **Under a collection grid.** After filtering and scrolling, the row is a shortcut back to the two or three products that actually interested them.
* **On the 404 page.** Someone who hit a dead link still has somewhere to go.

***

### Best practices

* Place it **below** the content that sells, not above it. It is a way back, not a headline.
* Keep the heading plain — **Recently viewed**, **Pick up where you left off**. The value is in the recognition, not the wording.
* Do not judge it from the theme editor. Test it on the live storefront after opening a few products.
* Avoid putting it on the product page directly under [Product recommendations](https://staylime.com/docs/avante-themes/sections/products/product-recommendations.md) — two product rows in a row read as filler.

***

### Related

* [Products overview](https://staylime.com/docs/avante-themes/sections/products.md)
* [Product recommendations](https://staylime.com/docs/avante-themes/sections/products/product-recommendations.md)
* [Cart recommendations](https://staylime.com/docs/avante-themes/sections/products/cart-recommendations.md)
* [Cart page](https://staylime.com/docs/avante-themes/templates/cart-page.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://staylime.com/docs/avante-themes/sections/products/recently-viewed-products.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
