Pagemetrics for Matomo
Pagemetrics for Matomo adds privacy-friendly, server-side analytics to WordPress by leveraging the pagemachine/matomo-tracking PHP library. When enabled, the plugin sends page view and optional download events from your WordPress site directly to a Matomo instance without loading Matomo’s JavaScript tracker. Key benefits: Track page views on the server with full control over attributes such as title, URL and referrer. Optional download tracking rewrites file links and records the click before redirecting visitors. Optional AI assistant bot tracking detects crawls from ChatGPT, Claude, Perplexity and others and forwards them to Matomo’s dedicated AI Assistants report. Multisite aware – network admins can define defaults, individual sites can override them. Respects Do Not Track and Global Privacy Control headers through the underlying library. Logs issues to the WordPress debug log when WP_DEBUG is enabled. Looking for expert help with Matomo or server-side tracking? Pagemachine offers consulting, implementation and ongoing support via our Pagemetrics solution. More info: Pagemetrics.eu Developer Hooks Page view tracking: pm_matomo_tracking_should_track_request — Return false to skip page view tracking for the current request. pm_matomo_tracking_visitor_ip — Override the visitor IP forwarded to Matomo as cip (defaults to REMOTE_ADDR; used for page views and downloads when an auth token is set). Return an empty string to skip IP forwarding. Download tracking: pm_matomo_tracking_should_rewrite_downloads — Return false to keep original download URLs for the current post. pm_matomo_tracking_is_download_url — Decide whether a specific URL should be rewritten (receives URL and default extension list). pm_matomo_tracking_download_extensions — Adjust the list of file extensions that count as downloads. pm_matomo_tracking_download_url — Customize the generated redirect URL used for download tracking. pm_matomo_tracking_download_redirect_status — Change the HTTP status code used when redirecting to the original file. AI assistant bot tracking: pm_matomo_tracking_ai_bot_user_agents — Extend or replace the list of User-Agent substrings used to detect AI bots. General: pm_matomo_tracking_log_message — Listen to debug messages emitted while WP_DEBUG is enabled. Example usages // Skip tracking for administrators. add_filter('pm_matomo_tracking_should_track_request', static function ($shouldTrack) { return current_user_can('manage_options') ? false : $shouldTrack; }); // Keep original download URLs on the privacy policy page. add_filter('pm_matomo_tracking_should_rewrite_downloads', static function ($shouldRewrite) { return is_page('privacy-policy') ? false : $shouldRewrite; }); // Force CDN assets to be treated as downloads. add_filter('pm_matomo_tracking_is_download_url', static function ($decision, $url) { return str_contains($url, 'cdn.example.com/assets/') ? true : $decision; }, 10, 2); // Add extra file types to download tracking. add_filter('pm_matomo_tracking_download_extensions', static function ($extensions) { $extensions = array_merge($extensions, ['svg', 'heic']); return array_unique($extensions); }); // Append a checksum to rewritten download URLs. add_filter('pm_matomo_tracking_download_url', static function ($trackingUrl, $target, $label) { $checksum = substr(hash('sha256', $target . $label), 0, 12); return add_query_arg('pm_checksum', $checksum, $trackingUrl); }, 10, 3); // Use a 307 redirect instead of the default 302. add_filter('pm_matomo_tracking_download_redirect_status', static function () { return 307; }); // Add a custom bot to AI assistant tracking. add_filter('pm_matomo_tracking_ai_bot_user_agents', static function (array $substrings): array { $substrings[] = 'MyCustomBot'; return $substrings; }); // Behind a reverse proxy: forward the real client IP from X-Forwarded-For. add_filter('pm_matomo_tracking_visitor_ip', static function ($ip, $request) { $forwarded = $request->getHeaderLine('X-Forwarded-For'); if ($forwarded === '') { return $ip; } // Use the first (client) address in the list. return trim(explode(',', $forwarded)[0]); }, 10, 2); // Forward debug messages to the PHP error log while developing. add_action('pm_matomo_tracking_log_message', static function ($level, $message) { if (!defined('WP_DEBUG') || WP_DEBUG !== true) { return; } // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log error_log(sprintf('[Pagemetrics for Matomo][%s] %s', strtoupper((string) $level), $message)); }, 10, 2);
Top keywords
- tracking29×4.53%
- matomo25×3.91%
- matomo tracking18×2.81%
- download16×2.50%
- return13×2.03%
- add12×1.88%
- 'pm10×1.56%
- 'pm matomo9×1.41%
- 'pm matomo tracking9×1.41%
- function9×1.41%
- pm9×1.41%
- pm matomo9×1.41%
Globe Visitors Counter
Globe Visitors Counter (Lite) adds a beautiful, fast, iframe-isolated 3D visitor globe to any WordPress site. It instantly shows your audience geography — fully locally, privately, and without any third-party tracking. This Lite version is designed for clarity, speed, and instant visual feedback — especially on landing pages and campaign pages. Use Case: Instant Visual Feedback for Advertising Campaigns The situation You have a product or a service. You launch an advertising campaign: Google Ads Facebook / Instagram TikTok banner ads email campaigns any other traffic source All traffic is sent to one landing page. Usually what comes next is boring: tables, charts, numbers, dashboards, “we’ll analyze it later”. The solution You place Globe Visitors Counter Lite directly on the landing page. No server setup. No external analytics. No configuration. And you start seeing your traffic with your own eyes. How it works (very simple) You launch the ads Visitors arrive at the page Each real visitor appears as a dot on the globe — in real time, from their actual location The globe comes alive and instantly shows: – whether people are coming at all – which countries and regions react – whether the campaign works or misses completely No dots — ads don’t work. Dots appear — ads are alive. Why Lite is perfect for landing pages Lite is not deep analytics. It’s a visual “life indicator”. Perfect when you need: – fast visual feedback – immediate confirmation that traffic is real – zero setup and zero learning curve – a simple “wow effect” for clients, teams, or investors You watch, not analyze. Key Features Interactive 3D Land-Cover globe included out of the box Real-time visitor logging using a tiny local JSON file Historical dots displayed automatically Zero configuration, works with all themes & editors Shortcode-based, easy placement on any page No cookies, no remote APIs, GDPR-friendly Ultra-fast loading thanks to iframe sandboxing How It Works When a page with the shortcode is opened, the plugin loads a fully self-contained viewer from: /wp-content/uploads/visitors-lite-landcover/ Each visit is logged locally as a minimal record (timestamp + coordinates + city + country) into: visitors.json Everything stays on your server. No tracking pixels. No third-party analytics. No cookies. Why Use It Ideal for landing pages and product launches Visualizes global audience instantly Safe for cached pages and CDNs Works even on heavily optimized sites When You May Need the Full Version Lite is intentionally simple and fast. If you need: – long-term statistics – multiple pages or sites – extended visitor history – advanced visual modes and skins – more control and customization …then the Full (Pro) version may be a better fit. Lite remains perfect for single pages, launches, tests, and quick visual validation. Tester Program (optional) We are tuning defaults and performance for upcoming builds. If you want to enable advanced features during testing at no cost (extra visual modes, effects, skins), join via Support: https://wordpress.org/support/topic/looking-for-testers-free-advanced-features-for-feedback/ Usage Shortcode: [visitors_globe_lite title=”VISITORS” width=”100%” height=”600″] Attributes: – title — optional caption above the globe – width — iframe width (100% or fixed px) – height — iframe height in px Place the shortcode anywhere — Classic or Block editor.