Title: Lightweight Google Analytics
Author: Andy Feliciotti
Published: <strong>24 Tháng 9, 2020</strong>
Last modified: 18 Tháng 1, 2026

---

Tìm kiếm plugin

![](https://ps.w.org/lightweight-google-analytics/assets/banner-772x250.jpg?rev=
2719903)

![](https://ps.w.org/lightweight-google-analytics/assets/icon-256x256.png?rev=2387397)

# Lightweight Google Analytics

 Bởi [Andy Feliciotti](https://profiles.wordpress.org/someguy9/)

[Tải về](https://downloads.wordpress.org/plugin/lightweight-google-analytics.1.5.0.zip)

 * [Chi tiết](https://vi.wordpress.org/plugins/lightweight-google-analytics/#description)
 * [Đánh giá](https://vi.wordpress.org/plugins/lightweight-google-analytics/#reviews)
 *  [Cài đặt](https://vi.wordpress.org/plugins/lightweight-google-analytics/#installation)
 * [Nhà phát triển](https://vi.wordpress.org/plugins/lightweight-google-analytics/#developers)

 [Hỗ trợ](https://wordpress.org/support/plugin/lightweight-google-analytics/)

## Mô tả

This simple plugin adds Google Analytics 4 (GA4) to your WordPress site using your
Measurement ID. Additional features include the ability to change the tracking code
position, disabling display features, anonymize IP, and excluding roles from tracking.

**Note:** Universal Analytics (UA-) was discontinued by Google on July 1, 2023. 
This plugin still supports UA tracking IDs for backwards compatibility, but we recommend
migrating to Google Analytics 4 (G-XXXXXXXX) for active tracking.

**Features**

 * Performance focused with no bloat
 * Extremely simple to setup
 * Works with Google Analytics 4 (gtag.js) — Universal Analytics (analytics.js) 
   still supported
 * Regular updates for when GA changes in the future
 * Only requires your GA tracking ID to work
 * Option to put the tracking code in the header or footer
 * Options to disable display features and anonymize IPs
 * Options to exclude specific roles from GA tracking
 * Option to use MinimalAnalytics.com’s tracking code (or MinimalAnalytics4 if using
   gtag.js)
 * Google Consent Mode v2 support for GDPR/CCPA compliance
 * Debug Mode for testing GA4 implementation
 * Works with WP-Rocket’s local GA script feature
 * Never any upsells

This plugin uses Google Analytics 4 (gtag.js) tracking code by default. Universal
Analytics (analytics.js) is still supported for backwards compatibility. It does
not include any built in reporting — to view your site statistics, visit Google 
Analytics after installing.

## Ảnh màn hình

 * [[
 * Plugin settings page for Lightweight Google Analytics

## Cài đặt

To install this plugin:

 1. Download the plugin
 2. Upload the plugin to the wp-content/plugins directory,
 3. Go to “plugins” in your WordPress admin, then click activate.
 4. You’ll see a new option for Lightweight Google Analytics in your settings tab.

## Hỏi đáp

### How do I find my Google Analytics 4 Measurement ID?

In Google Analytics, go to Admin > Data Streams > select your stream > copy the 
Measurement ID (starts with G-).

### What is Consent Mode and do I need it?

Google Consent Mode v2 helps you comply with GDPR/CCPA by denying analytics storage
until users consent. Enable it if you use a cookie consent plugin and need to comply
with privacy regulations.

### How do I test if tracking is working?

Enable Debug Mode in the plugin settings, then go to Google Analytics > Admin > 
DebugView to see real-time hits from your site. Remember to disable Debug Mode when
done testing.

### Is Universal Analytics (UA-) still supported?

Yes, for backwards compatibility. However, Google discontinued UA on July 1, 2023,
so data may no longer be processed. We recommend migrating to GA4.

## Đánh giá

![](https://secure.gravatar.com/avatar/bc248f07aded6aecc5c40cd06ea1cabce5a4fc651a8fc9bc099573200d840d61?
s=60&d=retro&r=g)

### 󠀁[Good plugin…](https://wordpress.org/support/topic/good-plugin-5436/)󠁿

 [VannDigital](https://profiles.wordpress.org/vdn-staff/) 16 Tháng 8, 2021 2 trả
lời

…so far. Hope it stays updated!!!

![](https://secure.gravatar.com/avatar/5c8f0880b104c6acfa0f0f9ffc9fc5733eda817ae78f89ab07387328bf47e777?
s=60&d=retro&r=g)

### 󠀁[Significantly reduced page load time](https://wordpress.org/support/topic/significantly-reduced-page-load-time/)󠁿

 [Ryan Robinson](https://profiles.wordpress.org/ryrob/) 30 Tháng 9, 2020

I’ve been on a quest to speed up my blog for a long time, and reducing the number
of requests my previous Google Analytics plugin was making (and the amount of code
it was injecting onto my site) was a major tipping point for getting my pages loading
lightning fast after making some other site-wide optimizations. I’m using the minimal
analytics option with the plugin and it took my GA file size down to 2kb (instead
of 17kb where it previously was with Monster Analytics). This plugin is incredibly
simple, easy-to-use and straight forward… it does exactly what it says!

 [ Đọc tất cả 2 đánh giá ](https://wordpress.org/support/plugin/lightweight-google-analytics/reviews/)

## Người đóng góp & Lập trình viên

“Lightweight Google Analytics” là mã nguồn mở. Những người sau đã đóng góp vào plugin
này.

Những người đóng góp

 *   [ Andy Feliciotti ](https://profiles.wordpress.org/someguy9/)

“Lightweight Google Analytics” đã được dịch qua 5 ngôn ngữ. Cảm ơn [những người tham gia dịch](https://translate.wordpress.org/projects/wp-plugins/lightweight-google-analytics/contributors)
vì đóng góp của họ.

[Dịch “Lightweight Google Analytics” sang ngôn ngữ của bạn.](https://translate.wordpress.org/projects/wp-plugins/lightweight-google-analytics)

### Muốn tham gia phát triển?

[Duyệt code](https://plugins.trac.wordpress.org/browser/lightweight-google-analytics/),
check out [SVN repository](https://plugins.svn.wordpress.org/lightweight-google-analytics/),
hoặc theo dõi [nhật ký phát triển](https://plugins.trac.wordpress.org/log/lightweight-google-analytics/)
qua [RSS](https://plugins.trac.wordpress.org/log/lightweight-google-analytics/?limit=100&mode=stop_on_copy&format=rss).

## Nhật ký thay đổi

#### 1.5.0

 * Added Google Consent Mode v2 support for GDPR/CCPA compliant tracking.
 * Added Debug Mode toggle for GA4 testing via DebugView.
 * Updated messaging to prioritize Google Analytics 4 (GA4) over deprecated Universal
   Analytics.
 * Added admin notice warning for sites still using Universal Analytics (UA-) tracking
   IDs.
 * Added note clarifying that IP anonymization is automatic in GA4.
 * Added input sanitization and validation for tracking IDs and all settings.
 * Code cleanup and optimization.
 * Tested up to WordPress 6.9.

#### 1.4.3

 * Tested up to WordPress 6.5.
 * Upgraded minimal analytics tracking scripts.

#### 1.4.2

 * Tested up to WordPress 6.3.

#### 1.4.1

 * PHP Error bugfix.

#### 1.4

 * Included MinimalAnalytics4 by [idarek on GitHub](https://gist.github.com/idarek/9ade69ac2a2ef00d98ab950426af5791).
   This allows you to use a gtag tracking code for page views & site search without
   loading Google’s bloated tracking library.
 * Removed jQuery references in the admin for vanilla JS.
 * Tested up to WordPress 6.0.

#### 1.3

 * Tested up to WordPress 5.8.
 * Added link to analytics.google.com in settings page

#### 1.2.2

 * PHP Warning bug fix.

#### 1.2.1

 * Tested up to WordPress 5.7.

#### 1.2.0

 * Added the ability to use Global site tag measurement ID (gtag.js) as well as 
   Universal Analytics tracking ID (analytics.js).

#### 1.1.1

 * Admin page tweaks and added a setup prompt at first install

#### 1.1.0

 * Added option to use MinimalAnalytics.com’s tracking code

#### 1.0.0

 * Initial Release.

## Meta

 *  Phiên bản **1.5.0**
 *  Cập nhật lần cuối **4 tháng trước**
 *  Số lượt cài đặt **400+**
 *  Phiên bản WordPress ** 5.0 hoặc cao hơn **
 *  Đã kiểm tra lên đến **6.9.4**
 *  Phiên bản PHP ** 7.0 hoặc cao hơn **
 *  Ngôn ngữ
 * [English (US)](https://wordpress.org/plugins/lightweight-google-analytics/), 
   [Spanish (Chile)](https://cl.wordpress.org/plugins/lightweight-google-analytics/),
   [Spanish (Colombia)](https://es-co.wordpress.org/plugins/lightweight-google-analytics/),
   [Spanish (Mexico)](https://es-mx.wordpress.org/plugins/lightweight-google-analytics/),
   [Spanish (Spain)](https://es.wordpress.org/plugins/lightweight-google-analytics/),
   và [Spanish (Venezuela)](https://ve.wordpress.org/plugins/lightweight-google-analytics/).
 *  [Dịch sang ngôn ngữ của bạn](https://translate.wordpress.org/projects/wp-plugins/lightweight-google-analytics)
 * Thẻ
 * [analytics](https://vi.wordpress.org/plugins/tags/analytics/)[consent mode](https://vi.wordpress.org/plugins/tags/consent-mode/)
   [ga4](https://vi.wordpress.org/plugins/tags/ga4/)[GDPR](https://vi.wordpress.org/plugins/tags/gdpr/)
   [google analytics](https://vi.wordpress.org/plugins/tags/google-analytics/)
 *  [Nâng cao](https://vi.wordpress.org/plugins/lightweight-google-analytics/advanced/)

## Đánh giá

 5 trên 5 sao.

 *  [  2 5-star reviews     ](https://wordpress.org/support/plugin/lightweight-google-analytics/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/lightweight-google-analytics/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/lightweight-google-analytics/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/lightweight-google-analytics/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/lightweight-google-analytics/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/lightweight-google-analytics/reviews/#new-post)

[Xem tất cả đánh giá](https://wordpress.org/support/plugin/lightweight-google-analytics/reviews/)

## Những người đóng góp

 *   [ Andy Feliciotti ](https://profiles.wordpress.org/someguy9/)

## Hỗ trợ

Có điều gì muốn nói? cần giúp đỡ?

 [Xem diễn đàn hỗ trợ](https://wordpress.org/support/plugin/lightweight-google-analytics/)

## Ủng hộ

Bạn có muốn hỗ trợ vào sự phát triển của plugin này?

 [ Ủng hộ plugin này ](https://www.buymeacoffee.com/someguy)