Description
MetricRaven shows where your visitors come from and which of those channels make money. This plugin adds the MetricRaven tracker to your WordPress site without editing theme files.
- One field to set up. Paste your site ID and every front-end page is tracked.
- Cookieless by default. Nothing is stored in the visitor’s browser until your consent banner grants it. Works with the WP Consent API (Complianz, CookieYes and other compatible banners).
- Excludes your own visits. Logged-in administrators, or any roles you pick, are not tracked.
- Built-in proxy. Optionally serve the script and events from your own domain so fewer visits are lost to ad blockers.
- WooCommerce revenue attribution. Saves the visitor ID on each order as hidden
_metricraven_visitor_idmeta, so the MetricRaven WooCommerce webhook credits revenue to the visit’s source, campaign and landing page. - Content-Security-Policy friendly. Add a nonce with the
metricraven_csp_noncefilter. Nonces that security plugins add throughwp_inline_script_attributesare kept. - Lightweight. One deferred script, no dashboard widgets, no database tables.
External services
This plugin connects your site to MetricRaven (https://metricraven.com), a third-party web analytics service run by MetricRaven. Nothing is loaded or sent until you enter a site ID in Settings MetricRaven, and logged-in users with excluded roles (administrators by default) are never tracked.
Tracker script and analytics events. On every front-end page view by a tracked visitor, the visitor’s browser loads https://metricraven.com/js/script.js (or the same file through this site in built-in proxy mode) and sends events to https://metricraven.com/api/v1/collect: page views, time spent on the page, clicks on links to other sites (host and path) and any custom events or goals you add. Each event carries your site ID, the page URL (including campaign parameters such as utm_source and ?ref=), the referrer and a timestamp; the request itself carries the visitor’s IP address and browser user agent. MetricRaven uses the IP address to look up country and city and to derive a daily visitor ID, and does not store it. Until the visitor consents (see the Consent setting), nothing is stored in the browser; with consent, a random visitor ID is kept in a first-party cookie and localStorage for a year and sent with each event.
Built-in proxy mode. When you choose “This WordPress site”, your server downloads script.js from MetricRaven at most once an hour (cached in a transient) and forwards each event the browser posts to /?mrp=event to https://metricraven.com/api/v1/collect, adding the visitor’s IP address, user agent, origin and referrer so location and device are recorded correctly.
WooCommerce. With revenue attribution on, the plugin saves the visitor ID on each order. The plugin itself sends no order data. Order details (amount, currency, status, line items, customer email and the saved visitor ID) reach MetricRaven only if you add the MetricRaven webhook under WooCommerce Settings Advanced Webhooks, which WooCommerce then delivers.
- Terms of service: https://metricraven.com/legal/terms
- Privacy policy: https://metricraven.com/legal/privacy
Installation
- In WordPress, go to Plugins Add New and search for “MetricRaven”, or upload the plugin zip under Plugins Add New Upload Plugin.
- Activate the plugin.
- Go to Settings MetricRaven, paste your site ID (from MetricRaven Settings Tracking & install) and save.
- Purge any page cache, open your site in a private window and check the visit appears in your MetricRaven dashboard.
WooCommerce
- In MetricRaven, open Settings Integrations WooCommerce and copy the webhook URL and secret.
- In WooCommerce Settings Advanced Webhooks, add a webhook for Order updated with that delivery URL and secret, API version 3.
- Keep Revenue attribution on in Settings MetricRaven.
FAQ
-
Not by default. Until the visitor consents, MetricRaven derives a daily visitor ID on its servers and stores nothing in the browser. Choose “Follow the WP Consent API” or call
analytics.setConsent(true)from your banner to keep a visitor ID across days. -
Once the cart has items, the plugin saves the visitor ID in the WooCommerce session that the cart already uses, and the classic checkout also sends it in a hidden field. No extra cookie is set.
-
My own visits still show up
-
Excluded roles only apply while you are logged in. To exclude a browser permanently, run
localStorage.ana_ignore = "1"in its developer console. -
A caching or optimization plugin broke tracking
-
Plugins that combine or delay JavaScript can drop
data-*attributes. Excludescript.js(or the?mrp=scriptURL in proxy mode) from combining and delaying. -
Can I add other tracker attributes?
-
Use the
metricraven_script_attributesfilter, for example to adddata-allow-localhoston a staging site.metricraven_should_trackturns tracking off for any request. -
What does uninstalling remove?
-
Deleting the plugin removes its settings and script cache. The
_metricraven_visitor_idmeta stays on past orders as part of their history.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“MetricRaven Analytics” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “MetricRaven Analytics” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.0.3
- Removed the custom script host setting: the tracker loads only from metricraven.com or through this site’s built-in proxy.
1.0.2
- Security: the WooCommerce visitor ID request checks a nonce.
- Security: the built-in proxy accepts events only from this site and validates the JSON body before forwarding it.
- The proxy exits early on requests without its query variable.
1.0.1
- Tested with WordPress 7.1.
- Translations load through WordPress.org language packs (removed the manual load_plugin_textdomain call).
- Readme: full External services disclosure.
1.0.0
- First release: tracker, role exclusion, consent modes, built-in proxy, custom host, WooCommerce attribution, CSP nonce support.

