recently-viewed-products

Track and display recently viewed products using browser storage with server-side data re-fetching.

3|1|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/tomtoto757/ecomm-ai-team --skill recently-viewed-products-tomtoto757
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: recently-viewed-products
Source: https://github.com/tomtoto757/ecomm-ai-team/tree/main/skills/storefront-shopping-experience/finsilabs/storefront-ui/recently-viewed-products
Command: npx skills add https://github.com/tomtoto757/ecomm-ai-team --skill recently-viewed-products-tomtoto757

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Shoppers often browse multiple products and lose track of items they were interested in, leading to abandoned sessions and lost sales. This Skill implements a "Recently Viewed" widget that records product views in browser storage and displays them on product pages, the cart, and the homepage so visitors can pick up where they left off. ## Core Features & Use Cases - Platform-Specific Setup Guides: Step-by-step instructions for enabling native Recently Viewed features on Shopify (OS2.0 themes, LimeSpot), WooCommerce (built-in widget and shortcode), and BigCommerce (Cornerstone, Page Builder). - Headless Implementation: Complete localStorage-based tracking utility with deduplication, 30-day TTL expiry, a 12-item cap, and a React widget that re-fetches fresh product data from a batch API endpoint to avoid stale prices or out-of-stock items. - Privacy and SSR Handling: Guidance for hydration-safe rendering in Next.js, silent failure in private browsing, and consent-aware storage writes. - Use Case: A fashion retailer adds a "You recently viewed" row to every product detail page and cart drawer, showing it only when the cart has fewer than 3 items as a subtle upsell. ## Quick Start Ask the AI to implement a recently viewed products widget for your storefront using localStorage tracking with a batch product lookup endpoint.

Frequently Asked Questions about recently-viewed-products

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a recently viewed products section to Shopify?▼

Shopify OS2.0 themes like Dawn include a native Recently Viewed section. Go to Online Store, then Themes, then Customize, open a product page template, click Add section, and select Recently viewed products. It uses localStorage automatically with no extra configuration.

How to implement recently viewed products in a headless storefront?▼

Store only product IDs with timestamps in localStorage, capped at 12 entries with a 30-day TTL. On render, send the IDs to a batch API endpoint via POST and re-fetch live product data so prices and stock status are never stale.

Does WooCommerce have a built-in recently viewed products widget?▼

Yes, WooCommerce includes a Recently Viewed Products widget out of the box. Place it via Appearance, then Widgets, or use the shortcode [woocommerce_recently_viewed_products per_page="4"] in templates or Gutenberg blocks. It stores IDs in the visitor session.

Why does my recently viewed widget cause hydration errors in Next.js?▼

Hydration mismatches occur when localStorage is read during server-side rendering. Read storage only inside useEffect, initialize component state as an empty array, and never access browser APIs in the render body.

What happens to recently viewed tracking in private browsing mode?▼

localStorage may throw errors in private or incognito mode. Wrap all storage reads and writes in try/catch blocks and fail silently, optionally falling back to an in-memory array or a server-side cookie-based implementation.

Should I store full product data in localStorage for recently viewed items?▼

No, store only product IDs and timestamps. Prices, images, and availability change frequently, so always re-fetch product details from the server when rendering the widget and filter to published, in-stock items only.