The Recently Viewed Products section displays products that customers have previously viewed during their browsing session. Using browser local storage to track viewing history, it creates a personalized shopping experience that helps customers quickly return to items of interest.Documentation Index
Fetch the complete documentation index at: https://docs.digifist.com/llms.txt
Use this file to discover all available pages before exploring further.
What this section controls
This section controls product history displays with the following capabilities:- Browser-based automatic product view tracking
- Display of 4-12 recently viewed products (configurable)
- Two layout styles for visual presentation
- Auto-hide when no product history exists
- Local storage persistence across visits
- Section heading with customizable size
- Product columns control for desktop and mobile
- Color scheme, width, and spacing controls
- Display on any page template
Key Features
Browser Storage
Personalized History
Auto-Hide Empty
Two Layouts
How It Works
Automatic Tracking
Automatic Tracking
- JavaScript automatically tracks when customers view product pages
- Stores product IDs in browser’s local storage
- Updates history in real-time as browsing continues
- Persists across multiple visits (until browser data is cleared)
- Only tracks products when customer visits product pages
- Excludes currently viewed product from display
- Stores up to configured maximum (4-12 products)
- Newest views push out oldest when limit is reached
Display Logic
Display Logic
- Customer has viewed at least one product
- Browser local storage contains product history
- Section is added to a page template (product page, homepage, etc.)
- No products have been viewed yet (first visit)
- Browser local storage is empty or cleared
- All recently viewed products are unavailable (if show unavailable is disabled)
- If viewing a product page, that product is excluded from the recently viewed list
- This prevents showing the same product the customer is currently viewing
Product Limit & Ordering
Product Limit & Ordering
- Default: 8 products
- Shows most recently viewed first
- Older products removed as new ones are viewed
- Newest viewed products appear first
- Chronological order from most to least recent
- Automatically updates as customer continues browsing
- Products arranged in responsive grid
- Number of columns adapts to screen size
- Uses theme’s standard product card component
Section Settings
Layout Style
Layout Style
- Layout 1: Standard layout style
- Layout 2: Alternative layout style
- Default: Layout 1
Section Header
Section Header
- Section title text
- Supports inline rich text (bold, italic, links)
- Default: “Recently Viewed Products”
- H6 (XS), H5 (S), H4 (M), H3 (L), H2 (XL)
- Default: H2 (XL)
Section Button
Section Button
Product Display
Product Display
- Range: 4-12 products
- Default: 8 products
- Controls how many products appear in the section
- More products = more scrolling required
- When enabled: Shows all recently viewed products (even if sold out)
- When disabled: Hides products that are unavailable
- Default: Disabled
Section Width & Color
Section Width & Color
- Page: Standard page width with margins
- Fluid: Minimal side margins, edge-to-edge
- Default: Page
- Choose from available color schemes
- Default: Scheme 1
Spacing & Borders
Spacing & Borders
- Padding above section: None, S (1), M (2), L (4), XL (6)
- Default: M (2)
- Padding below section: None, S (1), M (2), L (4), XL (6)
- Default: M (2)
- None, Top, Bottom, or Both
- Default: None
- Adds thin border line to separate section
Setup & Placement
Add Section
Test Tracking
Best Placement Locations
Product Pages
Homepage
Cart Page
Collection Pages
Technical Details
Browser Storage
Browser Storage
- Uses browser’s
localStorageAPI - Stores product IDs as JSON array
- Key typically:
recentlyViewedProductsor similar - Data persists until browser cache is cleared
- Most browsers allow ~5-10MB of local storage
- Product IDs are small (a few bytes each)
- Practically unlimited for product tracking purposes
- Data stored locally on customer’s device only
- Not sent to servers or shared
- Customers can clear via browser settings
- Respects private/incognito browsing limits
www.yourstore.com and yourstore.com, they may see different recently viewed products.JavaScript Requirements
JavaScript Requirements
- JavaScript must be enabled in browser
- Local storage must be available (not disabled)
- Modern browser (supports localStorage API)
- If JavaScript disabled: Section doesn’t appear
- If localStorage full: Oldest products removed first
- If localStorage blocked: Section hides gracefully
- Lightweight tracking code (~2-5KB)
- No server requests for tracking
- Fast rendering (products loaded from cache)
Product Card Integration
Product Card Integration
- Same card component as product grids
- Inherits theme’s product card settings
- Respects card layout configuration
- Includes images, titles, prices, variants
- Marked as “Sold Out” if setting is enabled
- Filtered out if setting is disabled
- Quick add/cart actions may be disabled
Best practices
Optimal product limits
Heading copy suggestions
Button strategy
Storage considerations
Testing requirements
Common troubleshooting
Common Questions
How long does viewing history persist?
How long does viewing history persist?
- Customer clears browser cache/cookies
- Customer uses browser’s “Clear browsing data” function
- Browser storage limit is reached and older data is removed
- Customer uses a different browser or device (each has separate storage)
Can I show more than 12 products?
Can I show more than 12 products?
- Overwhelming customers with too many options
- Performance issues with large product grids
- Excessive scrolling on mobile devices
max_products range, though this is not recommended for UX reasons.Does this work for guest visitors?
Does this work for guest visitors?
- Guest (not logged in)
- Logged-in customers
- First-time visitors (after viewing first product)
Why don't I see recently viewed products on my own store?
Why don't I see recently viewed products on my own store?
- You haven’t viewed any products yet in that browser session
- You cleared your browser cache recently
- You’re using incognito/private browsing mode (limited storage)
- JavaScript is disabled or blocked
- The section isn’t added to the current page template
Can I customize which products are tracked?
Can I customize which products are tracked?
- Exclude specific products from tracking
- Manually add products to viewing history
- Filter by collection or product type
- Prioritize certain products over others
Does this slow down my store?
Does this slow down my store?
- Tracking happens client-side (in browser)
- No server requests for tracking
- Minimal JavaScript (~2-5KB)
- Products loaded from browser cache
- No API calls required
Privacy & Data
GDPR & Privacy Compliance
GDPR & Privacy Compliance
- Stored locally on customer’s device only
- Not transmitted to servers
- Not shared with third parties
- Not used for tracking across sites
- Customers can clear data via browser settings
- Private/incognito browsing limits storage
- No customer account required
- Generally considered functional storage (required for feature)
- May not require explicit cookie consent in most jurisdictions
- Consult legal advisor for specific compliance requirements
Cross-Device Synchronization
Cross-Device Synchronization
- Each browser has independent storage
- Switching from mobile to desktop shows different histories
- Logging in doesn’t sync viewing history
- Clearing cache on one device doesn’t affect others
Related Sections & Features
- Product Recommendations: Shopify’s AI-powered recommendations (alternative approach)
- Featured Products: Manually curated product selections
- Product Grids: Standard product collection displays
- Card Product Component: The component used to display products in this section
Developer Notes
JavaScript API
JavaScript API
Local Storage Key
Local Storage Key
["123456", "234567", "345678"]