Analytics Head
Analytics Head is a deliberately simple WordPress plugin for Google Analytics. No dashboards, no Google account connection, no feature creep — just the tracking code, placed exactly where you want it. Why use this plugin? Lightweight — a handful of options, minimal overhead, no external dependencies Easy — paste your GA4 Measurement ID (G-XXXXXXXXXX) and you are done Head placement by default — required for Google Search Console verification via Analytics Flexible — footer placement, role-based hiding, Consent Mode v2, optional Google Ads IDs Developer-friendly — filters and actions to customize output without forking the plugin Unlike heavyweight analytics suites, this plugin does one job well: inject the standard gtag.js snippet into your site. Features Google tag / GA4 Measurement ID support (GT-…, G-XXXXXXXXXX) Additional tracking IDs for separate destinations (e.g. Google Ads AW-) Legacy UA- ID acceptance (with admin notice to migrate) Code in by default (optional footer placement) Tracking never injected in wp-admin Hide tracking for administrators on the front end Hide tracking per user role Google Consent Mode v2 defaults (for GDPR / cookie plugins) Keep settings on uninstall (optional) Developer hooks and filters External services This plugin connects to Google Analytics (via Google Tag Manager / gtag.js) to provide website analytics. When: on public front-end page views only (never in the WordPress admin area), unless tracking is hidden for the current visitor by plugin settings What is sent: standard Google Analytics measurement data (for example page URL, referrer, browser/device information, and IP-derived location), processed by Google Who receives it: Google LLC / Google Analytics Terms of Service: https://marketingplatform.google.com/about/analytics/terms/us/ Privacy Policy: https://policies.google.com/privacy You are responsible for informing visitors (for example in your privacy policy) and, where required, obtaining consent. Suggested privacy policy text is also offered under Settings → Privacy when the plugin is active. Requirements WordPress 6.3 or later (compatible with WordPress 7+) PHP 7.4 or later Examples Filter tracking IDs add_filter( 'pp_google_analytics_head_tracking_ids', function( $ids ) { // Add a separate destination only — not a second ID for the same Google tag. $ids[] = 'AW-123456789'; return $ids; } ); Change Consent Mode defaults (PHP) add_filter( 'pp_google_analytics_head_consent_defaults', function( $defaults ) { $defaults['wait_for_update'] = 2000; $defaults['region'] = [ 'PL', 'DE', 'US-CA' ]; return $defaults; } ); Grant consent after the user accepts cookies (JavaScript) Call this from your consent plugin callback or custom banner “Accept” handler. Update all four types that this plugin sets to denied by default: gtag('consent', 'update', { analytics_storage: 'granted', ad_storage: 'granted', ad_user_data: 'granted', ad_personalization: 'granted' }); If you only want basic analytics (not ads), grant analytics and keep ads denied: gtag('consent', 'update', { analytics_storage: 'granted', ad_storage: 'denied', ad_user_data: 'denied', ad_personalization: 'denied' }); Modify the inline gtag config add_filter( 'pp_google_analytics_head_inline_script', function( $script, $ids ) { $script .= "gtag('event','page_view');"; return $script; }, 10, 2 );
Top keywords
- google19×3.97%
- analytics16×3.34%
- tracking8×1.67%
- consent7×1.46%
- google analytics7×1.46%
- ids7×1.46%
- ad6×1.25%
- defaults6×1.25%
- gtag6×1.25%
- 'granted'5×1.04%
- head5×1.04%
- privacy5×1.04%
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.