Why the widget exists

An e-commerce purchase rarely happens in one visit. A shopper looks at products, leaves to think, comes back a day later. At that moment a browsing history widget is the shortest route back into an interrupted decision: no need to search again, remember a product name or rebuild a navigation path.

The widget lowers cognitive load and navigation depth — the shopper returns to the item in one click instead of three or four search steps.

Where to place it

Page Placement logic
Homepage Restore context when someone returns in a new session
Product page Show alternatives from their own history — you also viewed
Cart Remind them of items considered but never added
Empty cart Recover an interrupted intent
404 / empty search Keep the session alive at a dead end

Technical notes

Storing the history: for anonymous visitors, in a cookie or in localStorage, which needs no sign-in. For authenticated shoppers, server-side against the user ID.

Merging on login: when a shopper signs in, the local history merges with the server copy — the signals of the current session must not be lost. The merge strategy is a union with priority to the more recent views.

Filtering: exclude items already purchased (a closed intent), items out of stock (unless pre-order applies) and duplicates (one product should not appear twice in the carousel).

Tip: add a price-change indicator to the widget card — price dropped, or only three left. That turns a neutral reminder into a concrete reason to come back.