Metrics Query
This Google Analytics for WordPress plugin enables you to track your site using the latest Google Analytics tracking code and allows you to view key Google Analytics stats in your WordPress install. In addition to a set of general Google Analytics stats, in-depth Page reports and in-depth Post reports allow further segmentation of your analytics data, providing performance details for each post or page from your website. The Google Analytics tracking code is fully customizable through options and hooks, allowing advanced data collection like custom dimensions and events. Credits This plugin forked from Google Analytics Dashboard for WP Created by Alin Marcu and forked by Yehuda Hassine Google Analytics Real-Time Stats Google Analytics reports, in real-time, in your dashboard screen: Real-time number of visitors Real-time acquisition channels Real-time traffic sources details Google Analytics Reports The Google Analytics reports you need, on your dashboard, in your All Posts and All Pages screens, and on site’s frontend: Sessions, organic searches, page views, bounce rate analytics stats Locations, pages, referrers, keywords, 404 errors analytics stats Traffic channels, social networks, traffic mediums, search engines analytics stats Device categories, browsers, operating systems, screen resolutions, mobile brands analytics stats In addition, you can control who can view specific Google Analytics reports by setting permissions based on user roles. Google Analytics Tracking Installs the latest Google Analytics tracking code and allows full code customization: Universal Google Analytics (analytics.js) tracking code Global Site Tag (gtag.js) tracking code Enhanced link attribution Remarketing, demographics and interests tracking Page Speed sampling rate control User sampling rate control Cross domain tracking Exclude user roles from tracking Accelerated Mobile Pages (AMP) support for Google Analytics Ecommerce support for Google Analytics User privacy oriented features: IP address anonymization option to follow Do Not Track (DNT) sent by browsers support for user tracking opt-out Google Analytics Dashboard for WP enables you to easily track events like: Downloads Emails Outbound links Affiliate links Fragment identifiers Telephone Page Scrolling Depth Custom event categories, actions and labels using annotated HTML elements With Google Analytics Dashboard for WP you can use custom dimensions to track: Authors Publication year Publication month Categories Tags User engagement Actions and filters are available for further Google Analytics tracking code customization. Google Tag Manager Tracking As an alternative to Google Analytics tracking code, you can use Google Tag Manager for tracking: Google Tag Manager code Data Layer variables: authors, publication year, publication month, categories, tags, user type Exclude user roles from tracking Accelerated Mobile Pages (AMP) support for Google Tag Manager Accelerated Mobile Pages (AMP) features Google Tag Manager basic tracking Google Analytics basic tracking Automatically removes amp/ from Google Analytics tracking page URL Scrolling depth tracking Custom dimensions tracking User sampling rate control Form submit tracking File downloads tracking Affiliate links tracking Hashmarks, outbound links, telephones and e-mails tracking Custom event categories, actions and labels using annotated HTML elements Google Analytics Dashboard for WP on Multisite This plugin is fully compatible with multisite network installs, allowing three setup modes: Mode 1: network activated using multiple Google Analytics accounts Mode 2: network activated using a single Google Analytics account Mode 3: network deactivated using multiple Google Analytics accounts Localization You can translate Metrics Query on translate.wordpress.org.
Top keywords
- analytics32×5.96%
- google31×5.77%
- google analytics26×4.84%
- tracking24×4.47%
- code9×1.68%
- user9×1.68%
- analytics tracking7×1.30%
- google analytics tracking7×1.30%
- stats7×1.30%
- tracking code7×1.30%
- analytics stats6×1.12%
- dashboard6×1.12%
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);