SQMViews is a simple and lightweight tracking and analytics plugin that helps you understand how visitors interact with your WordPress content—without sending data to third-party services.
Plugin adds very little overhead, capable of tracking millions of page views per day on a moderately sized website.
Plugin includes sqm-views-pages.php drop-in script installation (Fast endpoint) to collect pageviews without loading WordPress core, reducing pageview request from 250 ms to 5 ms. If drop-in installation is not possible, the plugin falls back to the WordPress call (API endpoint).
Key Features
Tracking & Analytics:
- Near real-time page view tracking
- Engagement metrics (time on page, active time)
- Shows user activity (clicks, scrolls, etc.) with privacy-friendly event counting
- Interactive analytics dashboard with D3.js visualizations
- Historical data with daily aggregation
- Filter by date range, content type, and more
Performance:
- Ultra-fast tracking endpoint (bypasses a core load)
- Minimal overhead (~5ms per request with the drop-in script)
- File-based batch processing (no database requests during pageview event collection, only during cron processing)
- Efficient data storage with automatic archiving
- Configurable background processing via WP-Cron
Drop-in script
- Created to minimize overhead
- Uses exactly the same code as the API endpoint except two hooks for config modification (sqm_views_ping_interval, sqm_views_session_timeout)
- Run strict JSON request schema validation to minimize attack surface.
- Receives request, run validation, add it to a file for the later batch processing. Very low memory and CPU footprint.
Pageview lifetime
JS code will send an
init event, followed by ping events and completed by exit or timeout events. Unique ID is returned during init used for all the following events. During cron processing all the events with the same IDs are combined into a single pageview and stored in the database.
Privacy & Control:
- 100% privacy-focused (no external services)
- All data stays on your server
- Encrypted tracking payloads (you don't need to reveal everything you track)
- Full control over what gets tracked
- GDPR-friendly (no personal data collected by default), we focus on pageviews
Flexibility:
- Track custom post types and taxonomies
- 30+ developer hooks for customization
- WP-CLI commands for automation
- Translation-ready (i18n)
- REST API for integrations
What Gets Tracked?
Content Types:
- Posts and pages (configurable)
- Custom post types
- Category and tag archives
- Custom taxonomy archives
- Author archives
- Date archives
- Home page
-
Search results
Engagement Metrics:
-
Count - Total number of views
- Time on Page - Total time spent on page
- Active Time - Time user was actively engaged
- High-Frequency Events - User browsing on the page (scrolling, mouse movement)
- Low-Frequency Events - Deliberate actions (clicks, touches, typing)
Perfect For
- Publishers monitoring content performance
- Marketers analyzing user engagement
- Developers needing custom analytics
- Privacy-conscious site owners
- Anyone wanting Google Analytics alternative
How It Works
- Lightweight JavaScript tracker injected on tracked pages (inline or external)
- Fast endpoint receives tracking data
- File-based storage for raw data writes data to JSONL files (no database overhead)
- Background processing via WP-Cron aggregates data hourly/daily and put them in the database
- Interactive dashboard displays charts and metrics
Extensibility
30+ Developer Hooks:
- Frontend Hooks - Control what gets tracked and how
- Processing Hooks - Modify data before database storage
- REST API Hooks - Customize chart data and permissions
- Activation Hooks - Adjust default settings and storage
WP-CLI Support
`
Process statistics manually
wp sqm-views process
`
Multisite Compatible
Planned
Why Choose SQMViews?
vs External Analytics:
- No external JavaScript libraries
- No tracking cookies required
- No data sent to Google servers
- Faster page loads (no external requests)
- Complete data ownership
Requirements
- WordPress 6.0 or higher
- PHP 8.1 or higher (PHP 8.2+ recommended)
- PHP Sodium extension (for encryption)
- MySQL 5.6 or higher / MariaDB 10.0 or higher
- Write permissions for
wp-content/uploads/sqm-views directory
Credits
SearchQueryMaster.com team
Powered by:
- D3.js for visualizations
- WordPress CMS
- Sodium crypto library
Automatic Installation
- Log in to your WordPress admin panel
- Navigate to Plugins → Add New
- Search for "SQMViews"
- Click Install Now then Activate
- Go to SQMViews → Tracking Settings to configure
Manual Installation
- Download the plugin zip file
- Log in to your WordPress admin panel
- Navigate to Plugins → Add New → Upload Plugin
- Choose the zip file and click Install Now
- Click Activate Plugin
- Go to SQMViews → Tracking Settings to configure
First Steps After Installation
- Configure Tracking - Go to SQMViews → Tracking Settings
- Select which post types to track
- Choose taxonomy archives to monitor
- Select JavaScript loading method (inline/external)
- Set Processing Schedule - Go to SQMViews → Processing
- Choose cron interval (hourly recommended)
- Verify endpoint status (fast endpoint preferred)
- View Analytics (Once you have enough data) - Go to SQMViews → Statistics
- Explore interactive dashboard
- Filter by date range
- Compare different metrics
Performance Optimization
For best performance on high-traffic sites:
- Enable Fast Endpoint (automatic on most hosts)
- Copy sqm-views-pages.php in WordPress root folder (next to wp-config.php)
- Bypasses WordPress load
- Reduces tracking overhead from ~250ms to ~5ms
- Check status in Processing Settings
- Use External JavaScript (recommended for caching)
- Set in Tracking Settings
- Allows browser caching
- Slightly faster page loads
- Adjust Cron Interval
- Hourly: Good for most sites
- 15 minutes: High-traffic sites needing real-time data
- 6 hours/Daily: Low-traffic sites saving resources