跳到内容

Lean GA4 Tracker – GA4 and WooCommerce Event Tracking

v1.2.1

Maidul · 2025年4月2日 上架

Adds Google Analytics 4 (gtag.js) and WooCommerce shopping events. Classic cart and checkout only. Consent Mode is optional and off by default.

正在使用
10+
评分
暂无
累计下载
1,322
最近更新
2026年11月21日
需要 WordPress 6.2+已测试到 7.1.5PHP 8.2+

贡献者

截图

General tab: Configure GA4 Measurement ID and Script Load Mode
General tab: Configure GA4 Measurement ID and Script Load Mode
Tag Manager tab: Optional GTM container and user role exclusions
Tag Manager tab: Optional GTM container and user role exclusions
Authentication tab: optional Google account connection for the admin dashboard
Authentication tab: optional Google account connection for the admin dashboard
Events tab: Define custom GA4 events using a JSON array
Events tab: Define custom GA4 events using a JSON array
WooCommerce tab: Toggle GA4 eCommerce event tracking for product views, checkout, and purchases
WooCommerce tab: Toggle GA4 eCommerce event tracking for product views, checkout, and purchases
Forms tab (form tracking does not work in this version)
Forms tab (form tracking does not work in this version)
Privacy & Consent tab: Optional Consent Mode defaults
Privacy & Consent tab: Optional Consent Mode defaults
Debug tab: Enable Debug Mode to print event tracking output for admins
Debug tab: Enable Debug Mode to print event tracking output for admins

Lean GA4 Tracker adds the Google Analytics 4 tag (gtag.js) to your site from a settings page, and sends WooCommerce shopping events to GA4 for stores that use the classic cart and checkout pages. It has no reporting screens that you need: you read your data in Google Analytics.

What it does

  • Adds gtag.js with your GA4 Measurement ID (G-XXXXXXXXXX).
  • WooCommerce events on the classic shop, product, cart and checkout pages: view_item, view_item_list, select_item, view_cart, begin_checkout, add_shipping_info, add_payment_info and purchase, with product category and brand.
  • Optional Google Consent Mode defaults. Consent Mode is off until you turn it on in the Privacy tab.
  • Exclude user roles from tracking in the Tag Manager tab.
  • Your own custom GA4 events, entered as a JSON array in the Events tab. Each one fires on every page view.
  • Multisite: network-wide settings with optional enforcement.

Limits you should know about

  • WooCommerce Cart and Checkout blocks are not tracked. Events use the classic page hooks.
  • Add-to-cart and remove-from-cart events can be missed on some themes. Check them in GA4 DebugView before you rely on them.
  • The plugin does not track form submissions.
  • Consent Mode here is not a complete consent solution. Use it only together with a consent banner you have tested, and check that it meets your legal obligations.

Privacy. Once you save a Measurement ID, every visitor’s browser loads Google’s gtag.js and sends data to Google Analytics, including the visitor’s IP address and cookie identifiers. When WooCommerce tracking is enabled, product and order information is sent to GA4 (such as product name, category, brand, price and quantity). Customer names and email addresses are not sent. Mention Google Analytics in your privacy policy, and review your GA4 settings against your local privacy laws (such as GDPR and CCPA).

Resources

External services

When you enter a Measurement ID, this plugin loads Google’s tracking code in your visitors’ browsers.

Google Analytics (gtag.js) – https://www.googletagmanager.com/gtag/js. Loaded on every page for every visitor once a Measurement ID is saved. Google receives the visitor’s IP address, browser details, page URL and cookie identifiers, plus the WooCommerce and custom events described above.
Terms: https://marketingplatform.google.com/about/analytics/terms/us/ – Privacy policy: https://policies.google.com/privacy

Google Tag Manager – https://www.googletagmanager.com/gtm.js and https://www.googletagmanager.com/ns.html. Loaded only if you enter a Tag Manager container ID.
Terms: https://marketingplatform.google.com/about/analytics/tag-manager/use-policy/ – Privacy policy: https://policies.google.com/privacy

Google Analytics Admin and Data APIs – https://analyticsadmin.googleapis.com and https://analyticsdata.googleapis.com. Called from your server, in the admin only, if you enter a GA4 Property ID and an access token for the plugin’s dashboard report. Your token is sent to Google.
Terms: https://developers.google.com/terms – Privacy policy: https://policies.google.com/privacy

jsDelivr – https://cdn.jsdelivr.net. Serves the Chart.js library on the plugin’s admin dashboard page only. Your browser requests it when you open that page.
Terms: https://www.jsdelivr.com/terms – Privacy policy: https://www.jsdelivr.com/terms/privacy-policy-jsdelivr-net

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums