
內容簡介
您的 WordPress 網站包括第三方腳本和工具,例如網站流量分析、Feedburner 廣告橫幅計數或排行榜等。Google 標籤管理器(Tag Manager)提供全面的用戶界面,以管理所有這些腳本(標籤),並通過單個外掛將它們包含到您的 WordPress 網站中。
此外掛包括 JavaScript 代碼,將這些標籤帶入您的網站,還包括回退的 Iframe 代碼,以在不啟用 JavaScript 的情況下仍然提供功能。安裝只需要兩個簡單的步驟:
安裝此外掛。
在首選項中輸入容器 ID。
現在,您無需將大量腳本標籤復制和粘貼到 WordPress 主題文件中,也無需為不同的服務管理幾個外掛,您可以從單一來源(標籤管理器)提供這些所有內容。在 Google 用戶界面中舒適地管理標籤,無需進一步觸及您的 WordPress 安裝。
標籤管理器(https://www.google.com/tagmanager/)的註冊步驟簡單明了,在獲得容器 ID 後,這款外掛唯一需要的信息就是容器 ID。從現在開始,您可以享有以下幾項優點:
全面概述您使用的所有標籤
可以在標籤管理器中停用標籤
您可以在為訪問者載入更改之前在您的網站上預覽它們
為市場營銷人員提供標籤管理訪問權限 - 無需進行代碼更改
使用所有規則和宏精細調整標籤使用
除了標籤管理外,由於異步加載腳本,您還將注意到更快的網站加載時間。
技術內容:
WordPress 只允許將標籤管理器代碼放置在 wp_footer 操作鉤子後面的頁腳中。如果您想要將代碼直接放置在 body 標記後面,您需要像這樣編輯您的主題:
…
<body>
<?php global $wp_google_tag_manager;
if(is_object($wp_google_tag_manager) && is_a($wp_google_tag_manager,”WpGoogleTagManager”)){
$wp_google_tag_manager->output_manual();
} ?>
…
外掛標籤
開發者團隊
原文外掛簡介
Your wordpress website includes third party scripts and tools like website traffic analytics, ad banners counter by feedburner or some top lists. Google Tag Manager provides a comprehensive user interface to manage all these scripts (tags) and include them with a single plugin into your wordpress powered website.
This plugin includes both the javascript code to bring those tags into your site and the fall back iframe code to still provide functionality if javascript is disabled. Installation requires just two simple steps
Install the plugin.
Input the container ID in preferences
Instead of copy and pasting lots of script tags into you wordpress theme files or managing a couple of plugins for diverse services you can now serve this all from a single source – the Tag Manager. Tags are comfortably managed in the Google user interface, no need to further touch you wordpress installation.
Registration for Tag Manager (https://www.google.com/tagmanager/) is two simple steps before you receive the Container ID which is the only information the plugin requires to work properly. From now on, you have a couple of advantages:
a comprehensive overview of all tags you are using
tags can be deactivated in the Tag Manager
you can preview changes on your site before putting them live for your visitors
provide access to tags management for marketing staff – no code changes needed
use all the rules and macros to fine grained adjust tag usage
Besides management of tags you’ll notice better loading times of your website due to asynchonous loading of scripts.
Technical stuff:
WordPress only allows placement of tag-manager-code in the footer through wp_footer action hook. So if you want to place the code directly behind the body tag you have to edit your theme like this:
…
output_manual();
} ?>
…
