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 );
Koko Analytics – Privacy-Friendly WordPress Analytics
Koko Analytics is a privacy-friendly and lightweight Google Analytics alternative for WordPress sites. It is a plug and play solution to get GDPR compliant insights into your website visitors without requiring any third-party services. Why choose Koko Analytics? Important insights Koko Analytics provides you with simple and effective analytics. There are no complicated reports to dig through. All the important metrics are visible from a quick glance at your analytics dashboard, right inside your WordPress admin. Privacy-friendly analytics Koko Analytics is a privacy-friendly solution for WordPress. It can be used without any cookies, no personal data is processed or stored and nothing is shared with any third-party. That makes it suitable for GDPR, CCPA, and PECR-compliant website statistics. Lightweight website statistics Koko Analytics is lightweight. It adds less than 1 kilobyte of data to your pages and is fully compatible with all kinds of caching setups. WordPress is bypassed entirely for its collection endpoint, making the impact on your site’s performance as close to zero as possible. Open source analytics Koko Analytics is open source released under the GPL license, just like WordPress itself. The source code is publicly available. Everyone has the right to run, study, share or modify the source code. Features WordPress analytics dashboard – View your website statistics directly inside WordPress admin. Top posts and pages – See which content gets the most visits. Referrer statistics – Find out which websites send traffic to your site. Path-based tracking – Track statistics for any URL, including archives and search pages. Returning visitor detection – Reliably detect returning visitors without cookies. Exclusion rules – Exclude visits from selected WordPress user roles or IP addresses. Historical data imports – Import statistics from Jetpack Stats, Plausible Analytics, Burst Statistics, Statify, WP Statistics, Independent Analytics, or SlimStat Analytics. Automatic data cleanup – Remove historical data older than a chosen number of months or years. Popular posts output – Show your most visited posts or pages with a widget, Gutenberg block, or shortcode. Pageview counter – Show the total number of pageviews for a page with a shortcode or Gutenberg block. Koko Analytics Pro Koko Analytics Pro adds more reporting options for sites that need deeper analytics. Country statistics – See which countries your visitors come from. Technology reports – View browser, operating system, and device statistics. Email reports – Receive periodic analytics reports in your inbox. UTM Campaigns – Measure the performance of your marketing campaigns. Custom event tracking – Track outbound link clicks, contact form submissions, add-to-cart actions, and more. Traffic spike alerts – Get notified by email when traffic changes quickly. View the Koko Analytics live demo or see Koko Analytics Pro pricing.