This module monitors specified directories for file changes and tracks downloads, categorizing them into new user, update, and repeat downloads. It features role-based access control, intelligent version auditing, a visual analytics dashboard, and filters out bots for cleaner metrics.
π€ Development & AI Disclosure
This module was developed with the assistance of AI tools for scaffolding and prototyping, directed, reviewed, tested, and actively maintained by the author. Community feedback, code reviews, and issue queue contributions are warmly welcomed.
Full documentation is at https://blogs.jamesrome.net/download-tracker
Install using Composer
composer require drupal/download_tracker
drush pm:install download_trackerFeatures
Download Tracker is a high-performance Drupal module that monitors administrator-configured server directories for file changes and software releases, tracks file reads and downloads, and automatically categorizes downloads into New Users, Version Updates, and Repeat Downloads
π Watched Directory Management: Monitor any server folder (e.g., /sites/default/files/release, public://release, private://documents).
π₯ Role-Based Download Control: Granular access permissions per directory (e.g. restrict to Authenticated users or leave open for Anonymous visitors).
π Report Permissions in UI: Conveniently configure which roles can view analytics directly from the module settings page.
β‘ Intelligent Version Auditing: Automatically computes SHA-256 integrity hashes on disk to detect file updates and increment release versions (v1βv2β v3...).
π Visual Analytics Dashboard:
- High-level summary metrics cards (Total Files, Total Hits, New vs. Update vs. Repeat).
- Interactive data table with multi-column sorting across all metrics.
- Drill-down per-file audit trail with SHA-256 version history and chronological access logs (IP, User ID, Referrer, User-Agent).
- One-click CSV Export.
New in Version 1.0.6:
- Added recency badges (1 day: Red, 2 days: Green, 3 days: Blue) for file modifications and downloads.
- Added an Activity Key above both the overview table and detail tables.
- Added a sortable Last Downloaded column to the overview table and CSV export.
- Highlighted version history and download access logs by recency.
- Updated CSS, .cspell.json, and README.md.
π‘οΈ Transparent Static Link Redirection: Direct links to static file paths (e.g. https://example.com/sites/default/files/release/app.exe) automatically redirect to the tracker endpoint so no download is missed.
π€ Bot & Crawler Filtering: Automatically filters out search engine spiders (Google, Bing, Yandex, etc.) to keep your metrics clean.
Post-Installation
Configuration
Navigate to Configuration
βMedia
βDownload Tracker (/admin/config/media/download-tracker):
- Report Access Permissions: Check the roles permitted to view reports and statistics.
- Watched Directories: Configure your folders:
- Machine Key: e.g., release
- Label: e.g., Software Releases
- Directory Path: e.g., /sites/default/files/release or public://release
- Allowed Roles: Select roles allowed to download, or leave unchecked for open public access.
3. Click Save and Scan Directories Now.
TIP
Both standard paths with leading slashes (/sites/default/files/...), relative paths (sites/default/files/...), and Drupal stream wrappers (public://..., private://...) are automatically supported.
Additional Requirements
No
Recommended modules/libraries
No
Similar projects
Supporting this Module
I have a PayPay account: [email protected] if you wish to contribute.
Community Documentation
Full documentation is at https://blogs.jamesrome.net/download-tracker
Note
Automatic Static URL Interception: If users or external sites access legacy direct links like https://example.com/sites/default/files/release/mycode_v1.0.exe, the module automatically intercepts the request, routes it through the tracker to count the hit, and streams the file immediately.
π Reports & Analytics
See above image for meanings of the columns
βοΈ Drush CLI Integration
Command : Alias: Description
drush download-tracker:scan drush dt-scan Manually triggers a scan across all watched directories to catalog new files or version bumps.
Ask your assistant about Download Tracker
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.