PHPackages                             mattgrayisok/craft-recently-viewed - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mattgrayisok/craft-recently-viewed

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

mattgrayisok/craft-recently-viewed
==================================

Craft CMS plugin to find recently viewed elements of any type.

3.0.0(1y ago)136.9k1[3 issues](https://github.com/mattgrayisok/craft-recently-viewed/issues)MITPHPPHP ^8.0.0

Since Jan 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mattgrayisok/craft-recently-viewed)[ Packagist](https://packagist.org/packages/mattgrayisok/craft-recently-viewed)[ RSS](/packages/mattgrayisok-craft-recently-viewed/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (1)Versions (9)Used By (0)

Recently Viewed for Craft CMS 3
===============================

[](#recently-viewed-for-craft-cms-3)

Track what your users view and resurface it as you please.

Easily create lists of recently viewed articles, commerce products or anything else that you've modeled as an Element in Craft, even custom Element types.

Contents
--------

[](#contents)

- [License](#license)
- [Requirements](#installation)
- [Usage](#usage)
- [Filtering](#filtering)
- [Tracking](#tracking)
- [Clearing](#clearing)
- [Support](#support)
- [Credits](#credits)

License
-------

[](#license)

This plugin requires a commercial license which can be purchased through the Craft Plugin Store.
The license fee is $14 plus $5 per subsequent year for updates (optional).

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 3.0.0 or later.

For Craft 3 use version ^1.0.0

For Craft 4 use version ^2.0.0

Usage
-----

[](#usage)

Install the plugin from the Craft Plugin Store in your site's control panel or manually using composer:

```
composer require mattgrayisok/craft-recently-viewed

```

Filtering
---------

[](#filtering)

Once the plugin is installed you'll have access to two additional functions on all of your fluent element queries:

- `recentlyViewed()` - Filter by recently viewed elements only
- `orderByDateViewed()` - Order recently viewed elements by view date/time, most recent first

E.G.

```
{% set recentBlogPosts = craft.entries.section('blogPosts').recentlyViewed().orderByDateViewed().all() %}

```

```
{% set recentProducts = craft.products.recentlyViewed().orderByDateViewed().all() %}

```

Tracking
--------

[](#tracking)

By default any element which is linked to a specific URL will be auto tracked. I.E. if you visit `/blog/article-slug` and Craft has been configured to automatically inject the `entry` variable into the corresponding template the entry will be auto-tracked.

You can disable this auto tracking behaviour in the plugin settings.

You can also manually track views in your twig templates using:

`{% do craft.recentlyViewed.track(element) %}`

OR

`{% do craft.recentlyViewed.trackId(elementId) %}`

You can pass *any* element type into the former function as long as it implements `craft\base\ElementInterface`.

Clearing
--------

[](#clearing)

If you would like to clear the recently viewed history for any reason you can call:

`{% do craft.recentlyViewed.clear() %}`

Support
-------

[](#support)

If you encounter any issues during the use of this plugin please let me know by:

- Creating an issue on GitHub
- Dropping me an email: matt at mattgrayisok dot com
- Finding me in the Craft Slack: @mattgrayisok
- DMing me on Twitter: @mattgrayisok

I'll respond to critical issues as quickly as I can.

Credits
-------

[](#credits)

Created by [mattgrayisok](https://mattgrayisok.com/).

---

Icon made by [Smashicons](https://www.flaticon.com/authors/smashicons) from [www.flaticon.com](https://www.flaticon.com/) is licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/)

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~401 days

Recently: every ~502 days

Total

6

Last Release

674d ago

Major Versions

1.0.3 → 2.0.02022-05-12

2.0.0 → 3.0.02024-07-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/07a397bf9e17013ac2388b5a0cfef6c2be482f1f07afb6f9fc6ef4a90f301962?d=identicon)[mattgrayisok](/maintainers/mattgrayisok)

---

Top Contributors

[![mattgrayisok](https://avatars.githubusercontent.com/u/571107?v=4)](https://github.com/mattgrayisok "mattgrayisok (15 commits)")

---

Tags

cmsCraftcraftcmscraft-pluginrecentlyviewed

### Embed Badge

![Health badge](/badges/mattgrayisok-craft-recently-viewed/health.svg)

```
[![Health](https://phpackages.com/badges/mattgrayisok-craft-recently-viewed/health.svg)](https://phpackages.com/packages/mattgrayisok-craft-recently-viewed)
```

###  Alternatives

[verbb/navigation

Create navigation menus for your site.

90683.7k17](/packages/verbb-navigation)[verbb/formie

The most user-friendly forms plugin for Craft.

101372.9k40](/packages/verbb-formie)[verbb/comments

Add comments to your site.

13753.1k](/packages/verbb-comments)[verbb/tablemaker

Create customizable and user-defined table fields.

40168.8k1](/packages/verbb-tablemaker)[supercool/tablemaker

Create customizable and user-defined table fields.

40141.7k](/packages/supercool-tablemaker)[pennebaker/craft-architect

CraftCMS plugin to generate content models from JSON/YAML data.

72148.5k5](/packages/pennebaker-craft-architect)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
