Skip to content

WordPress plugin

The official Quiet Metrics plugin connects your WordPress site without touching code: first-party script, unblockable server-side tracking, or both.

Installation

Until it is published on the WordPress.org directory, the plugin ships as a .zip on request from support (Protected contact detail: enable JavaScript to reveal it): Plugins → Add New → Upload Plugin, activate it, then open Settings → Quiet Metrics. (To update, reinstall the .zip on top and your settings are preserved.)

Since version 0.7.0 the plugin requires PHP 8.3 or later, like the other integrations: PHP 8.1 no longer receives security fixes, and PHP 8.2 stops receiving them on 31 December 2026. On an older PHP the plugin stays inactive and says so in the admin; version 0.6 keeps working.

Setting Purpose
Site key qm_pub_… (dashboard → Install). Nothing is sent while it is empty.
Secret key qm_sec_…, optional, used by server mode: signed requests (HMAC), the service uses the visitor's IP and browser, not your server's.
Service URL https://quietmetrics.dev. Only change this for a dedicated instance or a test environment.
Mode Script, Server, or both (see below).
Exclusions Logged-in roles (administrators and editors by default) and path prefixes, one per line (e.g. /staging).

Choosing a mode

Script (first-party). The qm.js file is a local copy served by your own site, and requests would go through your site's REST API (/wp-json/quiet-metrics/v1/collect) before being relayed to the service. No third-party domain in the browser: domain-based blocklists are ineffective. This mode is not available yet: its relay runs through your server and would require a site signature that is not implemented yet, whatever secret key you enter. No visit is measured by this mode for now, and a message tells you so in the WordPress admin. This will be fixed when the plugin is published; use server mode in the meantime (see below).

Server (unblockable). Page views are sent by PHP at the end of the request, with no JavaScript: invisible to ad blockers. Fill in the secret key: without it, all your visitors would be counted with your server's IP (a single visitor!).

Both. The script tracks fine-grained navigation (SPAs, highly dynamic themes) and the server catches visitors who block JS. No double counting: the service deduplicates identical page views (same page, same visitor) received less than 2 seconds apart.

Edge cases

Full-page caching (WP Rocket, WP Super Cache, Varnish, Cloudflare APO…). In server mode, PHP does not run on pages served from the cache: those visits are not counted. With a full-page cache, use script mode (or both): the JS runs in the visitor's browser, cache or not.

Security plugins that restrict the REST API. Script mode relays requests via POST /wp-json/quiet-metrics/v1/collect: this public route must remain accessible (whitelist the quiet-metrics/v1 namespace in your security plugin). Symptom of a block: 401/403 errors on this route in the browser's Network tab.

Multisite. Settings are specific to each site in the network. Create one Quiet Metrics site (and key) per WordPress site to keep statistics separate.

Logged-in accounts. The roles checked in the settings are never counted, neither on the script side (the file is not injected) nor on the server side.

Visitor-requested exclusion. Anyone loading any page of your site with ?qm_ignore=1 stops being counted, and ?qm_ignore=0 puts them back into measurement. The plugin handles it with no setting to touch, across all three collection modes: see the opt-out marker. This does not replace the excluded roles and paths: those belong to the administrator, the marker belongs to the visitor.

What gets sent. From version 0.5.0 of the plugin, both modes only send what Quiet Metrics reads: the page address reduced to its origin, its path and its campaign parameters, and the referrer reduced to its origin. Details in the script guide and the PHP SDK.

Custom events

In the browser (script mode active):

<script>qm('signup', { plan: 'pro' });</script>

In PHP (theme, hook, anywhere after plugins are loaded):

quiet_metrics_event( 'purchase', array( 'amount' => 49 ) );

A WooCommerce example that counts confirmed orders:

add_action( 'woocommerce_thankyou', function ( $order_id ) {
    $order = wc_get_order( $order_id );
    if ( $order ) {
        quiet_metrics_event( 'purchase', array(
            'amount' => (float) $order->get_total(),
            'items' => $order->get_item_count(),
        ) );
    }
} );

The PHP call is non-blocking and silent on failure: analytics never breaks your store. To count a conversion, create the purchase goal (event type) in the dashboard.

Pageviews and errors (0.4.0)

Automatic pageviews are HTML/XHTML documents rendered in response to a GET, including 404/500 errors. Redirects, empty responses (204/205), PDFs, JSON and attachments are excluded, along with AJAX, announced prefetches and opted-out visitors.

From version 0.4.0, Pages introuvables also emits a 404 event with the page path. This option is off by default: each additional event consumes quota. Enable it server-side or through the script’s data-404 on a given page to avoid duplicate events. Server tracking cannot see pages served by a cache that bypasses PHP.

Dashboard widget (0.7.0)

From version 0.7.0, the plugin can show your figures in the WordPress dashboard: daily visitors (summed), page views and sessions over the last 30 days with their change on the previous period, a visitors trend, the five most viewed pages, and a link to Quiet Metrics.

The read API, and so the widget, is reserved for the Pro and Agency plans and ongoing trials: on another plan, the widget says that access was refused.

Create a read token restricted to this site (Dashboard → API tokens) and paste it in Settings → Quiet Metrics → Jeton de lecture. The field is masked and never shows the saved token again: leave it empty to keep it, or tick the box to delete it. The token is kept in its own option, not loaded on every page, and only used for server-side calls; the figures are kept ten minutes in a transient.

The widget is only shown to users who can manage options (manage_options). To change that, use the quiet_metrics_dashboard_capability filter:

add_filter( 'quiet_metrics_dashboard_capability', function () {
    return 'edit_posts';
} );