Title: Google Tag Manager
Author: George Stephanis
Published: <strong>2012 年 10 月 4 日</strong>
Last modified: 2026 年 6 月 9 日

---

搜尋外掛

![](https://s.w.org/plugins/geopattern-icon/google-tag-manager.svg)

# Google Tag Manager

 由 [George Stephanis](https://profiles.wordpress.org/georgestephanis/) 開發

[下載](https://downloads.wordpress.org/plugin/google-tag-manager.1.0.4.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/google-tag-manager/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/google-tag-manager/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/google-tag-manager/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/google-tag-manager/#developers)

 [技術支援](https://wordpress.org/support/plugin/google-tag-manager/)

## 外掛說明

[You can sign up for a Google Tag Manager account here.](https://www.google.com/tagmanager/)

This plugin makes it even easier to use Google Tag Manager, adding all the code 
itself — all you need to do is provide the Account ID!

## 安裝方式

 1. Upload `google-tag-manager.php` to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Go to `Settings` > `General` and set the ID from your Google Tag Manager account.

## 常見問題集

### Why isn’t the output displaying?

Two possibilities: First, you haven’t yet specified the ID in the admin panel, or
second, your theme is missing a `<?php wp_footer(); ?>` call.

## 使用者評論

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

### 󠀁[Hermosura de Plugins](https://wordpress.org/support/topic/hermosura-de-plugins/)󠁿

 [petterbriones](https://profiles.wordpress.org/petterbriones/) 2021 年 1 月 9 日

Otros plugins no me enviarvan al información de Google Analytics 4 pero este en 
un ratito lo solucionó, es genial y sencillo

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

### 󠀁[Super-simple way of adding GTM code](https://wordpress.org/support/topic/super-simple-way-of-adding-gtm-code/)󠁿

 [stevehanlon](https://profiles.wordpress.org/stevehanlon/) 2021 年 1 月 4 日

Perfect!

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

### 󠀁[Es simple y funciona](https://wordpress.org/support/topic/es-simple-y-funciona/)󠁿

 [Albeiro Ochoa](https://profiles.wordpress.org/albeiro/) 2020 年 6 月 12 日

Sin tantas complicaciones, funciona correctamente

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

### 󠀁[Love it](https://wordpress.org/support/topic/love-it-1657/)󠁿

 [Gagan Deep Singh](https://profiles.wordpress.org/gagan0123/) 2017 年 3 月 19 日

Does what it says, inserts just the GTM code at the right time at the right location.
Fell in love with the simplicity of this plugin, wonder why it does not show up 
in top when looking for GTM plugin for WP. Had to mess around with so many other
plugins before I found it. All other related plugins are too complex, and slows 
down the site as well. This plugin does what its supposed to do and nothing else
🙂 “LESS is MORE” Kudos to the author for such a beautiful implementation. One suggestion
though, if there would have been a single “do_action” with some custom action, before
printing the GTM code, could make it easier to add some custom JS variables, if 
needed, to pass along to GTM, rather than printing them at wp_head with priority
9.

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

### 󠀁[This just inserts the code right?](https://wordpress.org/support/topic/this-just-inserts-the-code-right/)󠁿

 [Firelight](https://profiles.wordpress.org/mdc2957/) 2017 年 2 月 10 日

I’m trying to follow some youtube tutorials on GTM. They say to install the code
manually, however, I use a child theme and I don’t know how to insert the code via
functions php file. There are other GTM plugins, but they have so many options and
things I’m afraid they will interfere with the tutorials. From reading the description,
it sounds like the only thing your plugin does is insert the GTM code in the correct
places. It doesn’t do anything else, am I correct?

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

### 󠀁[Works Great After Update](https://wordpress.org/support/topic/works-great-after-update/)󠁿

 [Micah Wood](https://profiles.wordpress.org/woodent/) 2017 年 1 月 27 日

I know there’s been a lot of frustration with this plugin in the past, but after
making the plugin author aware of Google’s change to how the Tag Manager scripts
should be loaded, he’s updated the plugin and it works great. I’ve tested version
1.0.2 of the plugin by dynamically injecting a Google Analytics script through the
Google Tag Manager (which didn’t work properly in version 1.0.1) and it now works
perfectly!

 [ 閱讀全部 10 則使用者評論 ](https://wordpress.org/support/plugin/google-tag-manager/reviews/)

## 參與者及開發者

以下人員參與了開源軟體〈Google Tag Manager〉的開發相關工作。

參與者

 *   [ George Stephanis ](https://profiles.wordpress.org/georgestephanis/)

[將〈Google Tag Manager〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/google-tag-manager)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/google-tag-manager/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/google-tag-manager/)，或透過
[RSS](https://plugins.trac.wordpress.org/log/google-tag-manager/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/google-tag-manager/)。

## 變更記錄

#### 1.0.4

 * Security: escape option value on output in settings field.
 * Standards: update `register_setting()` to array form; use `sanitize_text_field`
   instead of `esc_attr` on save.
 * Standards: replace `add_filter` with `add_action` for `admin_init` hook.
 * Standards: rename class to `Google_Tag_Manager` (UpperCamelCase).
 * Standards: extract HTML from translatable string in settings field.
 * Performance: raise `wp_head` priority to 1 so GTM snippet loads as early as possible.
 * Housekeeping: update Plugin URI to https and current path.

#### 1.0.3

 * Add support for the new `wp_body_open` hook in core.

#### 1.0.2

 * Switch to the new split-format for Google Tag Manager javascript and iframe format.
 * Add support for Genesis and Theme Hook Alliance themes to echo the iframe sooner
   in the dom.

#### 1.0.1

 * Change to static methods to avoid errors in some versions of php

#### 1.0

 * Initial Public Release

## 中繼資料

 *  版本 **1.0.4**
 *  最後更新 **3 週前**
 *  啟用安裝數 **10,000+**
 *  WordPress 版本需求 ** 2.7 或更新版本 **
 *  已測試相容的 WordPress 版本 **7.0**
 *  語言
 * [English (US)](https://wordpress.org/plugins/google-tag-manager/)
 * 標籤:
 * [analytics](https://tw.wordpress.org/plugins/tags/analytics/)[google](https://tw.wordpress.org/plugins/tags/google/)
   [tag management](https://tw.wordpress.org/plugins/tags/tag-management/)[tag manager](https://tw.wordpress.org/plugins/tags/tag-manager/)
   [theme hook alliance](https://tw.wordpress.org/plugins/tags/theme-hook-alliance/)
 *  [進階檢視](https://tw.wordpress.org/plugins/google-tag-manager/advanced/)

## 評分

 4.2 星，滿分為 5 星

 *  [  7 個 5 星使用者評論     ](https://wordpress.org/support/plugin/google-tag-manager/reviews/?filter=5)
 *  [  1 個 4 星使用者評論     ](https://wordpress.org/support/plugin/google-tag-manager/reviews/?filter=4)
 *  [  0 個 3 星使用者評論     ](https://wordpress.org/support/plugin/google-tag-manager/reviews/?filter=3)
 *  [  1 個 2 星使用者評論     ](https://wordpress.org/support/plugin/google-tag-manager/reviews/?filter=2)
 *  [  1 個 1 星使用者評論     ](https://wordpress.org/support/plugin/google-tag-manager/reviews/?filter=1)

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

[查看全部使用者評論](https://wordpress.org/support/plugin/google-tag-manager/reviews/)

## 參與者

 *   [ George Stephanis ](https://profiles.wordpress.org/georgestephanis/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/google-tag-manager/)

## 贊助

想要支援這個外掛的發展嗎？

 [ 贊助這個外掛 ](http://www.charitywater.org/donate/)