前言介紹
- 這款 WordPress 外掛「GTM4WP – A Google Tag Manager (GTM) plugin for WordPress」是 2013-09-22 上架。
- 目前有 700000 個安裝啟用數。
- 上一次更新是 2024-12-09,距離現在已有 145 天。
- 外掛最低要求 WordPress 3.4.0 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 7.4 以上。
- 有 152 人給過評分。
- 論壇上目前有 20 個提問,問題解答率 15%
外掛協作開發者
外掛標籤
gtm | google | adwords | tag manager | google tag manager |
內容簡介
Google Tag Manager (GTM) 是 Google 免費工具,讓每個人都能使用直覺的網頁 UI 管理並部署分析和行銷標籤,以及其他程式碼片段。欲瞭解更多此工具信息,請前往官方網站。
此外掛會將 GTM 容器代碼片段放置到 WordPress 網站上,以免用戶手動添加。此外掛也支援多個容器!
此外掛會透過將頁面元數據和用戶信息推送到所謂的數據層來補充 GTM 設定。
Google 官方幫助頁面包含更多有關數據層的信息。同時,此外掛還推薦使用建議替代方法添加 Google Optimize 容器。
使用此外掛需要 PHP 7.4。
GTM 容器代碼放置
原始的 GTM 容器代碼分為兩個部分:
第一部分是一個 JavaScript 代碼片段,它被添加到網站每個頁面的 head 部分,這一部分對啟用 GTM 的所有功能至關重要,此外掛可幫助在您的網站上正確放置此部分代碼;
第二部分是一個 iframe 代碼片段,當用戶的 JavaScript 被禁用時,它充當一個失敗安全/回退選項。為了獲得最佳性能,Google 建議將此代碼直接放置在每個頁面的 body 標記後。雖然這不是理想的方式,但是將代碼放置在低於此位置也可以運作。此外掛提供了代碼放置選項用於放置第二部分代碼片段。
如果您的 WordPress 主題與 WordPress 5.2 的添加兼容,則此外掛將此第二代碼放置在正確位置。Genesis 主題、GeneratePress 主題、Elementor、Oxygen Builder 和 Beaver Builder 主題的用戶也將正確地放置此代碼。為了利用它,請使用“ 无代码”放置選项。
所有其他用戶都可以使用自定義 PHP 代碼将此第二代碼放置到您的WordPress主题中,或者選擇所謂的“页脚”選項以在代码的下半部分添加代碼(這不是推薦的方式但是有效)。
基本數據包括:
文章/頁面標題、日期、分類名稱、標籤名稱、作者和文章/頁面ID、文章類型、當前頁面上的文章數量+當前類別/標籤/稅額上的文章數量、與任何文章類型相關聯的自定義術語、登錄狀態、登錄用戶角色、登錄用戶ID(以在 Google Analytics 中跟踪跨設備行為)、登錄用戶電子郵件地址(為遵守 GTM 服務條款,請勿將此傳遞給 Google 標記)、日誌用戶創建日期、站點搜索數據、站點名稱和ID(適用於WordPress多站點實例)、訪客的IP地址(請獲得訪問者的明確同意後再使用其)
瀏覽器/操作系統/設備數據:
(此程序需要使用 WhichBrowser 库提供的数据)瀏覽器數據(名稱、版本、引擎)、操作系統數據(名稱、版本)和設備數據(類型、制造商、型號)。
天气數據(測試版)
傳送有關用戶當前天氣的數據。
原文外掛簡介
Google Tag Manager (GTM) is Google’s free tool for everyone to manage and deploy analytics and marketing tags as well as other code snippets
using an intuitive web UI. To learn more about this tool, visit the official website.
This plugin places the GTM container code snippets onto your WordPress website so that you do not need to add it manually.
Multiple containers are also supported!
The plugin complements your GTM setup by pushing page meta data and user information into the so called data layer.
Google’s official help pages includes more details about the data layer.
PHP 7.4 is required to use this plugin.
GTM container code placement
The original GTM container code is divided into two parts:
The first part is a javascript code snippet that is added to the
This part is critical to enable all features of GTM, and this plugin helps to place this part
correctly on your site.
The second part is an iframe snippet that acts as a failsafe/fallback should users’ JavaScript be disabled.
Google recommends – for best performance – to place this code snippet directly after the opening tag on each page.
Albeit not ideal, it will work when placed lower in the code. This plugin provides a code placement option for the second code snippet.
If your WordPress theme is compatible with the additions of WordPress 5.2 then this plugin will place this second code to the right place.
Users of the Genisis theme, GeneratePress theme, Elementor, Oxygen Builder and Beaver Builder Theme will also have this placed correctly.
To utilize this, set the compatibility mode in plugin options to off.
All other users can place this second code snippet using a custom PHP code (“Manually coded” option) or select the so called “Footer” option to
add the code lower in the code (it is not the recommended way but will work)
Basic data included
post/page titles
post/page dates
post/page category names
post/page tag names
post/page author ID and name
post/page ID
post types
post format
post count on the current page + in the current category/tag/taxonomy
custom terms associated with any post type
logged in status
logged in user role
logged in user ID (to track cross device behaviour in Google Analytics)
logged in user email address (both unhashed and SHA256 hased values to be used with tracking)
logger in user creation date
site search data
site name and id (for WordPress multisite instances)
IP address of the visitor (please use the explicit consent of the visitor to utilize this)
Browser / OS / Device data
browser data (name, version, engine)
OS data (name, version)
device data (type, manufacturer, model)
Data is provided using the WhichBrowser library: http://whichbrowser.net/
Weather data
(beta)
Push data about users’ current weather conditions into the dataLayer. This can be used to generate weather-related
audience/remarketing lists on ad platforms and allows for user segmentation in your web analytics solutions:
weather category (clouds, rain, snow, etc.)
weather description: more detailed data
temperature in Celsius or Fahrenheit
air pressure
wind speed and degrees
Weather data is queried from Open Weather Map. Depending on your websites traffic, additional fees may apply:
http://openweathermap.org/price
An (free) API key from OpenWeatherMap is required for this feature to work.
ipstack.com is used to determine the site visitor’s location. A (free) API key from IPStack.com is required for this feature to work:
https://ipstack.com/product
Media player events
(experimental)
Track users’ interaction with any embedded media:
YouTube
Vimeo
Soundcloud
DataLayer events can be chosen to fire upon media player load, media is being played, paused/stopped and optionally when
the user reaches 10, 20, 30, …, 90, 100% of the media duration.
Tracking is supported for embedded media using the built-in oEmbed feature of WordPress as well as most other media plugins
and copy/pasted codes. Players injected into the website after page load are not currently supported.
Scroll tracking
Fire tags based on how the visitor scrolls from the top to the bottom of a page.
An example would be to separate “readers” (who spend a specified amount of time on a page) from “scrollers”
(who only scroll through within seconds). You can use these events to fire Analytics tags and/or remarketing/conversion tags
(for micro conversions).
Scroll tracking is based on the solution originally created by
Nick Mihailovski
Thomas Baekdal
Avinash Kaushik
Joost de Valk
Eivind Savio
Justin Cutroni
Original script:
http://cutroni.com/blog/2012/02/21/advanced-content-tracking-with-google-analytics-part-1/
Blacklist & Whitelist Tag Manager tags, triggers and variables
To increase website security, you have the option to white- and blacklist tags/triggers/variables.
You can prevent specific tags from firing or the use of certain variable types regardless of your GTM setup.
If the Google account associated with your GTM account is being hacked, an attacker could easily
execute malware on your website without accessing its code on your hosting server. By blacklisting custom HTML tags
and/or custom JavaScript variables you can secure the Tag Manager container.
Integration
Google Tag Manager for WordPress integrates with several popular plugins. More integration to come!
Contact Form 7: fire an event when a Contact Form 7 form was submitted with any result (mail sent, mail failed, spam detected, invalid input)
WooCommerce:
Implementation of GA4 E-commerce
Does not support promotions since WooCommerce does not have such a feature (yet)
Does not support refunds
Compatibility with High Performance Order Storage (HPOS)
AMP: load your AMP container on the AMP version of your pages
Cookiebot: use automatic cookie blocking mode if needed
Google Consent Mode v2: fire the “default” command with specific consent flags to integrat with non-certified Consent Management Platforms (CMPs) and plugins.
Server side containers
If you are using a server side container
you can enter your custom domain name and custom path to load gtm.js from your there.
Exclude specific user roles from being tracked
You can set which user roles needs to be excluded from tracking when a user with that role visits the frontend. This will completely disable the container code for that user.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「GTM4WP – A Google Tag Manager (GTM) plugin for WordPress」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1.0 | 1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6 | 1.7 | 1.8 | 1.9 | 1.10 | 1.11 | 1.12 | 1.13 | 1.14 | 1.15 | 1.16 | 1.18 | 1.19 | 1.20 | 0.5.1 | 0.7.1 | 0.8.1 | 0.8.2 | 0.9.1 | 1.1.1 | 1.3.1 | 1.3.2 | 1.5.1 | 1.6.1 | 1.7.1 | 1.7.2 | 1.8.1 | 1.9.1 | 1.9.2 | trunk | 1.10.1 | 1.11.1 | 1.11.2 | 1.11.3 | 1.11.4 | 1.11.5 | 1.11.6 | 1.12.1 | 1.12.2 | 1.12.3 | 1.13.1 | 1.14.1 | 1.14.2 | 1.15.1 | 1.15.2 | 1.16.1 | 1.16.2 | 1.18.1 | 1.19.1 | 1.20.1 | 1.20.2 | 1.20.3 |
延伸相關外掛(你可能也想知道)
Tag Manager – Header, Body And Footer 》標籤管理器是一個簡單的外掛程式,它可以讓你在網站頁頭、開始 body 標籤之後和結束 body 標籤之前的頁尾區域插入/注入程式碼。你可以使用此外掛程式為 Googl...。
Metronet Tag Manager 》將 Google Tag Manager 整合到您的網站中。, Google Tag Manager(GTM)的好處是您能夠在一個地方收集大部分的追蹤腳本。然後,您可以按照您設置的規則隨時啟...。
Google Tag Manager 》你可以在此註冊 Google Tag Manager 帳戶。, 這個外掛讓使用 Google Tag Manager 更加容易,它會自動加入所有的程式碼,你只需要提供帳戶 ID 就行了!, 。
GTM Server Side 》如果你正在尋找在 WordPress 網站上實現伺服器端追蹤的最簡單方法,stape.io 的 GTM Server Side 外掛是最好的解決方案。它可以輕鬆修改 gtm 指令碼,標記伺...。
Tealium 》功能, 讓使用者能輕鬆地添加 Tealium 標籤,而不需要修改任何範本檔案。, 在您的 WordPress 網站中添加了包含以下資料的數據層:, , 網站名稱, 網站描述, 文...。
Amplitude – Analytics, Session Replay, A/B testing and CDP for your website 》**摘要:**, 透過官方的 Amplitude Analytics 外掛,釋放您的 WordPress 網站潛力。這款強大的工具將關於您的 WordPress 網站的全面分析直接帶入您的 Amplitu...。
WP Analytics Tag Manager 》WP Analytics Tag Manager 可以幫助您管理內嵌的標籤,例如 Google Analytics。, 不需要編輯 PHP 檔案。, 此外,它還包括以下功能。, * 輸出頁面設定(全部頁...。
Easy Google Tag Manager 》The Easy Google Tag Manager plugin adds a field to the existing General Settings page for the ID and displays the javascript in the front-end foote...。
PLX Lead Reporting 》此外掛可加速 Google Tag Manager 整合,提供不同樣式且可匯入的 GTM JSON,將 Tag Manager 腳本添加至 Header 和 Body 中,並為 Contact Form 7 整合設置 Ja...。
Adobe DTM for WordPress 》Adobe DTM 是 Adobe 的工具,可用於將其行銷雲工具或任何其他標籤部署到網站上。 Adobe DTM for WordPress 插件是第一個專門設置和配置 WordPress 上的 Adobe...。
DeMomentSomTres WP Admin GTM 》DeMomentSomTres Google Tag Manager for WP-Admin 可以將 DuracellTomi 的 Google Tag Manager 擴展到 WordPress 網站管理功能中。, 歷史與目的, 我們重建了...。
EchBay Tag Manager 》標籤管理外掛和 Google Tag Manager 相似。可以輕鬆設定 Facebook 像素或 Google 轉換追蹤等 Javascript 代碼、CSS 代碼和 HTML 代碼,並且可以管理自定義的...。
Server Side Tagging via Google Tag Manager for WooCommerce (GTM Server Side) 》總結:本外掛提供了Server端追蹤Google Analytics 4、Google Ads、Meta(Facebook + Instagram)、Tiktok和Snapchat,以提升準確性和隱私。支援各項交互和轉...。
LighTag – Lightweight Google Tag Manager 》以下為翻譯後的總結:, , 介紹最輕量化的 Google Tag Manager WordPress 外掛!插件透過簡化操作介面,剔除不必要的功能和代碼,製作出極速且超輕量化的插件...。
Cookie Dash 》Cookie Dash 是一款 WordPress 外掛,旨在以符合廣泛數據隱私合規要求的方式,協助人們在其 WordPress 網站上部署 Google Tag Manager。, 隱私法律是複雜的,...。