Title: WPAC Integration for Google Analytics
Author: WP Agency Care
Published: <strong>2025 年 9 月 3 日</strong>
Last modified: 2025 年 12 月 9 日

---

搜索插件

![](https://ps.w.org/wpac-integration-for-google-analytics/assets/banner-772x250.
jpg?rev=3355244)

![](https://ps.w.org/wpac-integration-for-google-analytics/assets/icon-128x128.png?
rev=3355247)

# WPAC Integration for Google Analytics

 作者：[WP Agency Care](https://profiles.wordpress.org/wpagencycare/)

[下载](https://downloads.wordpress.org/plugin/wpac-integration-for-google-analytics.1.1.4.zip)

 * [详情](https://cn.wordpress.org/plugins/wpac-integration-for-google-analytics/#description)
 * [评价](https://cn.wordpress.org/plugins/wpac-integration-for-google-analytics/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/wpac-integration-for-google-analytics/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/wpac-integration-for-google-analytics/#developers)

 [支持](https://wordpress.org/support/plugin/wpac-integration-for-google-analytics/)

## 描述

This plugin provides a simple and lightweight solution to add Google Analytics tracking
to your WordPress website. It supports both Universal Analytics (analytics.js and
gtag.js) and the latest Google Analytics 4 (GA4).

Key Features:
 * Easy setup with your Tracking ID. * Supports Universal Analytics(
UA) and Google Analytics 4 (GA4). * Choice between analytics.js and gtag.js for 
Universal Analytics. * Option to place tracking code in the header or footer. * 
Simple, no-frills interface. * Lightweight and performant. * Fully compliant with
WordPress Coding Standards. * Enhanced security with proper input sanitization and
output escaping. * Tracking ID validation for GA4 and Universal Analytics formats.*
Modern PHP 8.0+ code with type declarations.

### External Services

This plugin connects to Google Analytics and Google Tag Manager services to provide
website analytics tracking functionality.

**Google Analytics (analytics.google.com):**
 * **What it is used for:** Website
analytics and visitor tracking * **What data is sent:** Page views, user interactions,
and website usage statistics * **When data is sent:** Every time a visitor loads
a page on your website * **Terms of Service:** [Google Analytics Terms of Service](https://marketingplatform.google.com/about/analytics/terms/)***
Privacy Policy:** [Google Privacy Policy](https://policies.google.com/privacy)

**Google Tag Manager (googletagmanager.com):**
 * **What it is used for:** Loading
Google Analytics tracking code and managing tags * **What data is sent:** Page load
requests to load the tracking script * **When data is sent:** Every time a visitor
loads a page on your website * **Terms of Service:** [Google Tag Manager Terms of Service](https://developers.google.com/tag-manager/terms)***
Privacy Policy:** [Google Privacy Policy](https://policies.google.com/privacy)

**Note:** This plugin only sends data to Google services when tracking is enabled
in the plugin settings. Users can disable tracking at any time through the WordPress
admin panel.

## 屏幕截图

 * [[
 * The settings page.
 * [[
 * The setup guide.

## 安装

 1. Upload the `wpac-integration-for-google-analytics` folder to the `/wp-content/plugins/`
    directory.
 2. Activate the plugin through the ‘Plugins’ menu in WordPress.
 3. Go to ‘WPAC Integration for Google Analytics’ -> ‘WPAC Setup’ in your WordPress
    admin menu.
 4. Enter your Google Analytics Tracking ID, choose your settings, and save.

## 常见问题

### How do I find my Google Analytics Tracking ID?

We have included a setup guide in the plugin. Navigate to ‘WPAC Integration for 
Google Analytics’ -> ‘Setup Guide’ in your WordPress admin for a step-by-step tutorial
on how to find your Tracking ID.

### Does this plugin support GA4?

Yes, it supports GA4, as well as Universal Analytics (gtag.js and analytics.js).
You can select your preferred method in the plugin settings.

### Where is the tracking code placed?

You can choose to place the tracking code in the website’s `<head>` section or in
the footer, just before the closing `</body>` tag. This can be configured in the
plugin settings.

## 评价

此插件暂无评价。

## 贡献者及开发者

「WPAC Integration for Google Analytics」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ WP Agency Care ](https://profiles.wordpress.org/wpagencycare/)

[帮助将「WPAC Integration for Google Analytics」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/wpac-integration-for-google-analytics)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/wpac-integration-for-google-analytics/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/wpac-integration-for-google-analytics/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/wpac-integration-for-google-analytics/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/wpac-integration-for-google-analytics/)。

## 更新日志

#### 1.1.4

 * Major code refactoring and modernization:
    - Updated to PHP 8.0+ with full type declarations and modern syntax.
    - Enhanced security with comprehensive input sanitization and output escaping.
    - Fixed Analytics.js script loading issue.
    - Added tracking ID format validation (GA4 and Universal Analytics).
    - Improved performance with optimized script enqueuing.
    - Full WordPress Coding Standards compliance.
    - Added proper internationalization support.
    - Enhanced error handling and activation checks.
    - Improved code organization and maintainability.
 * Branding, prefix, and compliance updates for WordPress.org review.

#### 1.1.1

 * Initial release as WPAC Integration for Google Analytics (formerly WPAC GA Analytics).

## 额外信息

 *  版本 **1.1.4**
 *  最后更新：**5 月前**
 *  活跃安装数量 **不到10**
 *  WordPress 版本 ** 5.0 或更高版本 **
 *  已测试的最高版本为 **6.8.5**
 *  PHP 版本 ** 8.0 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/wpac-integration-for-google-analytics/)
 * 标签
 * [ga4](https://cn.wordpress.org/plugins/tags/ga4/)[google analytics](https://cn.wordpress.org/plugins/tags/google-analytics/)
   [gtag](https://cn.wordpress.org/plugins/tags/gtag/)[tracking](https://cn.wordpress.org/plugins/tags/tracking/)
   [universal analytics](https://cn.wordpress.org/plugins/tags/universal-analytics/)
 *  [高级视图](https://cn.wordpress.org/plugins/wpac-integration-for-google-analytics/advanced/)

## 评级

尚未提交反馈。

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

[查看全部评论](https://wordpress.org/support/plugin/wpac-integration-for-google-analytics/reviews/)

## 贡献者

 *   [ WP Agency Care ](https://profiles.wordpress.org/wpagencycare/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/wpac-integration-for-google-analytics/)