Project utility Live

Obsidian View Tracker

An Obsidian plugin that tracks note view counts and last-viewed dates in YAML frontmatter.

View Tracker is an Obsidian plugin that records how many times each note has been opened. Every view increments a counter and updates a timestamp directly in the note’s YAML frontmatter, so the data lives alongside the content with no external database or network calls.

A configurable deduplication window (default 30 seconds) prevents inflated counts from rapid re-opens or tab switches. Tracking can be enabled per note by adding a frontmatter flag, or globally via a settings toggle. A command palette action makes it easy to flip tracking on or off for the current note.

Field names for the view count, last-viewed timestamp, and opt-in flag are all customizable. Timestamps support configurable IANA timezones and a 12-hour or 24-hour format option, rendering human-friendly strings like “Mar 10, 2026 3:45 PM EST.”

The plugin is a single TypeScript file bundled with esbuild. It uses the native Intl.DateTimeFormat API for timezone-aware formatting, avoiding extra dependencies.

Why

Obsidian stores everything as local Markdown files, but there’s no built-in way to know which notes you actually revisit. View Tracker fills that gap by embedding usage data right in the frontmatter, keeping it portable and queryable with tools like Dataview. No servers, no telemetry, just a counter in each note.

How

The plugin registers a file-open event listener that calls processFrontMatter() to increment a views counter and write a formatted timestamp. An in-memory Map handles deduplication within a configurable time window to avoid inflating counts on rapid re-opens. Timestamps are formatted with the native Intl.DateTimeFormat API, supporting IANA timezones without requiring moment-timezone. The entire plugin is a single TypeScript file bundled to CommonJS with esbuild.

Tech

Metrics

No metrics yet.