=== Lean GA4 Tracker === Contributors: maidulcu Tags: google analytics, GA4, tracking, lightweight Requires at least: 6.2 Tested up to: 6.7 Stable tag: 1.0.3 Requires PHP: 8.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html A lightweight, developer-friendly plugin to integrate Google Analytics 4 (GA4) tracking with WordPress. == Description == A lightweight, developer-friendly plugin to integrate Google Analytics 4 (GA4) tracking with WordPress. Designed for performance and simplicity, Lean GA4 Tracker lets you implement advanced GA4 tracking without the bloat of larger analytics plugins. == Key Features: == - Easy integration with GA4 using your Measurement ID - Lightweight, performance-first architecture with no bloat - Support for Consent Mode defaults (ad_storage and analytics_storage) - Site-level and Multisite Network-level settings with optional enforcement - Configurable script loading (default, async, or defer) - Custom GA4 Event Tracking via JSON input - Debug Mode for inspecting events in the console (admin only) - Error notices for invalid JSON in Custom Events field - Clean, class-based architecture with Composer and PSR-4 autoloading - Developer-friendly and extensible for custom implementations Whether you’re a developer building custom themes or a site owner who wants full control over analytics, Lean GA4 Tracker delivers exactly what you need — nothing more, nothing less. == Installation == 1. Upload the plugin files to /wp-content/plugins/lean-ga4-tracker 2. Activate the plugin from your WordPress dashboard 3. Go to Settings → Lean GA4 Tracker to configure == Frequently Asked Questions == = Can I track custom events without writing JavaScript? = Yes. You can enter a JSON array of custom GA4 events in the settings panel, and they will be dispatched automatically. = How does the plugin support Consent Mode? = It initializes GA4 with `ad_storage: denied` and `analytics_storage: granted` by default. You can modify or extend this via hooks. = Does this plugin support multisite networks? = Yes. Network admins can enforce a GA4 configuration across all sites or allow individual site overrides. = Where is the GA4 script loaded? = The script can be loaded using standard, `async`, or `defer` attributes — configurable from the admin settings. = Is the plugin suitable for developers? = Absolutely. The plugin is built using PSR-4 autoloading, Composer, and separates concerns with namespaced classes. It’s ready for extension or integration in your theme or stack. == Changelog == = 1.0.3 = * Improved GA4 inline script injection with reliable output structure * Replaced empty script handle with placeholder registration for consistent rendering * Verified compatibility with themes and ensured presence of GA4 tag in frontend = 1.0.2 = * Refactored to a modular, class-based architecture using namespaces * Added support for multisite network settings with enforcement * Introduced debug mode and custom event JSON handling * Integrated script loading mode (default, async, defer) * Added error notices for invalid JSON input = 1.0.1 = * Update code following PHPCS * escaped all code properly = 1.0 = * Initial Release