Minimal GA4 Tracker WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA
★ 0stars
9release downloads
v1.1.6latest · 6mo ago
Install
Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/breonwilliams/minimal-ga4-tracker/releases/download/v1.1.6/minimal-ga4-tracker-1.1.6.zipUpdates itself. It ships its own updater, so new versions appear under Dashboard → Updates.
Lightweight Google Analytics 4 tracking for WordPress without the bloat.
Features
- Simple setup with just your GA4 Measurement ID
- Async script loading for optimal performance
- Option to disable tracking for administrators
- Automatic exclusion of admin pages, feeds, previews, REST API, AJAX, and cron
- Developer-friendly with filter hooks for customization
- GitHub-based auto-updates
Installation
From GitHub Releases
- Download the latest release ZIP from the Releases page
- In WordPress admin, go to Plugins > Add New > Upload Plugin
- Upload the ZIP file and activate
Manual Installation
- Clone or download this repository
- Copy the
minimal-ga4-trackerfolder to/wp-content/plugins/ - Activate through the Plugins menu
Configuration
- Go to Settings > GA4 Tracker
- Enter your GA4 Measurement ID (e.g.,
G-XXXXXXXXXX) - Optionally check "Disable for Administrators" to exclude admin tracking
- Save changes
Find your Measurement ID in Google Analytics: Admin > Data Streams > select your stream.
Developer Hooks
mga4_gtag_config Filter
Modify the gtag configuration parameters:
add_filter( 'mga4_gtag_config', function( $config, $measurement_id ) {
// Disable automatic page view tracking
$config['send_page_view'] = false;
// Add custom parameters
$config['user_id'] = get_current_user_id();
return $config;
}, 10, 2 );
Custom Events
Track custom events using the standard gtag function:
// Basic event
gtag('event', 'button_click', {
'button_name': 'signup'
});
// E-commerce event
gtag('event', 'purchase', {
'transaction_id': 'T12345',
'value': 99.99,
'currency': 'USD'
});
Clearing Update Cache
If you need to force-check for updates, visit:
/wp-admin/?clear_mga4_update_cache=1
License
GPL-2.0-or-later
Releases
6 releases. Each count is every asset in that release; expand a row for the breakdown.