Overview
Metron (Greek for measure) provides a high-performance, privacy-focused alternative to Google Analytics. It features a lightweight standalone tracking endpoint, an asynchronous batch-processing queue, and an elegant dashboard—keeping your traffic data entirely on your own server without bogging down your database.
Architectural Rationale:
Third-party tracking scripts (Google Analytics) transfer European citizen data to third countries, requiring intrusive cookie banners under the GDPR and ePrivacy Directive. Meanwhile, typical WordPress analytics plugins lock database tables with synchronous INSERT queries on every visit. Metron solves this via an asynchronous <1kb beacon, a sub-20ms SHORTINIT endpoint, and daily-salted IP hashing.
Developer Integration
// Standalone high-speed beacon payload (<1kb overhead)
fetch('/wp-content/plugins/metron/beacon.php', {
method: 'POST',
body: JSON.stringify({
url: window.location.pathname,
ref: document.referrer,
screen: screen.width
}),
keepalive: true
});
WP-CLI: $ wp metron wipe --force
Deployment Notes
IP hashes are generated with secret salt + current date, rendering cross-day user fingerprinting cryptographically impossible.