WordPress plugin intelligence profile

Lightweight Google Analytics

Easily add Google Analytics 4 to WordPress using just your Measurement ID.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 7.1
Current version1.7.0
WordPress coverageTested up to WordPress 7.1
Minimum stackWP 5.7 · PHP 7.0
Directory statusactive
Last directory update13 Oct 202620d ago
Active installations400Adoption metric — not a quality score
WordPress.org rating5.0 / 5 from 2 ratings
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Lightweight Google Analytics version 1.7.0 as active, updated 20d ago and tested up to WordPress 7.1.

Overview

About this plugin

This simple plugin adds Google Analytics 4 (GA4) to your WordPress site using your Measurement ID. js snippet, nothing more, with a few options for where it loads, who gets tracked, privacy and testing.

Features

  • Performance focused with no bloat and never any upsells
  • Only needs your GA4 Measurement ID (G-XXXXXXXX), or paste Google’s whole tag snippet and the ID is picked out of it
  • Load the tracking code in the header or footer
  • Exclude logged-in users by role (admins, editors and authors are excluded by default)
  • Post previews and the Customizer are never tracked
  • Option to disable Google’s advertising features (Google signals)
  • Google Consent Mode v2 support for GDPR/CCPA compliance, working automatically with consent plugins that support the WP Consent API (such as Complianz and CookieYes)
  • Option to honor Global Privacy Control, the opt-out signal sent by Brave, DuckDuckGo and Firefox
  • Optional content groups: the post’s category (or page type) as GA4’s Content group, plus the author’s name, so you can compare sections and authors in reports
  • Warns you on the settings page when another plugin, your theme or a pasted snippet also adds Google Analytics, so page views aren’t counted twice
  • Debug Mode for testing in GA4 DebugView
  • Optional Minimal Analytics 4 mode: a 3.5 KB inline script that reports page views, scrolls, downloads, outbound clicks and site searches without loading gtag.js at all
  • The settings page tells you whether tracking is live and why your own visits may not show up
  • Filters for developers to change the gtag config, the consent defaults or when tracking is skipped

The plugin does not include any reporting. To see your statistics, open Google Analytics.

Note: Universal Analytics (UA-) was shut down by Google in 2023 and is no longer supported. If you still have a UA- ID saved, the plugin outputs nothing until you enter a GA4 Measurement ID.

For developers

), for example to disable the automatic page view or set cookie flags:

add_filter( 'lightweight_ga_gtag_config', function ( $config, $measurement_id ) { $config['send_page_view'] = false; $config['cookie_flags'] = 'SameSite=None;Secure'; return $config; }, 10, 2 );

Change the Consent Mode defaults, for example to only deny storage for EU visitors:

add_filter( 'lightweight_ga_consent_defaults', function ( $defaults ) { $defaults['region'] = array( 'AT', 'BE', 'DE', 'FR', 'IE', 'NL' ); return $defaults; } );

Change the content group or author sent with each page (when Content Groups is on), or add more page-level parameters:

add_filter( 'lightweight_ga_page_dimensions', function ( $dimensions ) { if ( is_page( 'pricing' ) ) { $dimensions['content_group'] = 'Sales'; } return $dimensions; } );

Skip the tracking code for any request:

add_filter( 'lightweight_ga_disable_tracking', function ( $disabled ) { return $disabled || is_page( 'internal-dashboard' ); } );

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • consent mode
  • google analytics
  • ga4
  • gdpr
Compatibility & maintenance

Compatibility & maintenance

Tested with WP 7.1

Marked as tested with the current WordPress 7.1 release.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to7.1
Minimum requirementsWordPress 5.7 · PHP 7.0
Update activity13 Oct 202620d ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

Version1.6.01.7.0
WordPress compatibility7.17.1.3
Version1.5.01.6.0
WordPress compatibility6.9.77.1
WordPress requirement5.05.7
Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.