Statrio Analytics
WordPress plugin for Statrio Analytics
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/statrio/wordpress/archive/refs/heads/main.zipStatrio Analytics for WordPress
Connect your WordPress site to Statrio — lightweight, privacy-friendly analytics. The plugin handles script injection, role-based exclusions, GDPR consent gating, custom events, and integrations with WooCommerce and popular form plugins.
Requirements
- WordPress 5.8+
- PHP 7.4+
Installation
- Download the plugin zip from your Statrio dashboard or GitHub releases.
- In WordPress Admin go to Plugins → Add New → Upload Plugin.
- Upload the zip, install, and activate.
- Go to Settings → Statrio and enter your domain key.
Alternatively, clone or symlink the folder directly into wp-content/plugins/statrio/.
Configuration
All settings live under Settings → Statrio.
Core
| Setting | Description |
|---|---|
| Enable Tracking | Master on/off switch. |
| Domain Key | The domain registered in your Statrio dashboard (e.g. yourdomain.com). |
| Script Source | Load from the Statrio CDN (cdn.statrio.com/js/sr.js) or self-host the script from the plugin's /dist/sr.js. |
| Outbound Link Tracking | Adds data-outbound="true" to automatically track external link clicks. |
Exclusions
| Setting | Description |
|---|---|
| Exclude Logged-in Users | Suppresses the script for all logged-in users. |
| Exclude by Role | Per-role checkboxes — suppress the script for administrators, editors, etc. |
| Skip on Debug / Staging | Does not inject the script when WP_DEBUG is true or the STATRIO_ENV constant is set to "staging". |
GDPR / Consent Mode
When Require Consent Cookie is enabled, the script tag includes a data-consent-cookie attribute. The Statrio script will wait until that cookie is present before initialising — compatible with Complianz, CookieYes, and any CMP that sets a cookie on analytics acceptance.
Set the Consent Cookie Name to match whatever cookie your CMP writes (default: statrio_consent).
Integrations
Integrations are shown only when the corresponding plugin is active.
| Plugin | Events fired |
|---|---|
| WooCommerce | add_to_cart, checkout_start, purchase |
| Contact Form 7 | form_submit |
| WPForms | form_submit |
| Gravity Forms | form_submit |
Script Preview
The settings page shows the exact `