Some Shopify themes and apps have a feature to display browsing history in a carousel, but this is a separate example of a setting that marks the browsing history directly on the product card of a collection page. This is effective for stores that list many similar products.
Example of how to display "Viewed" on collection pages and featured collection sections of the Shopify theme "Rise/Dawn" for products that customers have viewed once.

[(For the Rise/Dawn theme) How to set it up] Add a customized Liquid section to the header section group and insert the code.

