內容簡介
Tracking Code For Google Tag Manager 是一個簡單、輕量級的 WordPress 外掛程式,用於插入 Google Tag Manager 追蹤碼。這個外掛只會做一件事情,就是將標準的 Google Tag Manager 追蹤腳本列印到網站的 <head> 中。要插入您的容器 ID,請前往「設定」>「一般」,然後捲動頁面到底部。
Composer
composer require claytoncollie/tracking-code-for-google-tag-manager
篩選器
如果您想要在不使用 wp-admin 使用者介面的情況下設定容器 ID,可以使用下面的篩選器。
add_filter(
'tracking_code_for_google_tag_manager_id',
/**
* 設定 Google Tag Manager 容器 ID。
*
* @param string $container_id 容器 ID。
*
* @return string
*/
function ( $container_id ) {
return 'GTM-7654321';
}
);
貢獻
儘管這個外掛的目的是非常嚴格的,但歡迎問題和拉取請求,但我不保證所有的部分都會合併或支援。
https://github.com/claytoncollie/tracking-code-for-google-tag-manager
外掛標籤
開發者團隊
② 後台搜尋「Tracking Code for Google Tag Manager」→ 直接安裝(推薦)
原文外掛簡介
Tracking Code For Google Tag Manager is a simple, lightweight WordPress plugin for inserting your Google Tag Manager tracking code. The plugin does one thing and one thing only; prints the standard Google Tag Manager tacking script to the
of your website. To insert your container ID, navigate to Settings > General and then scroll to the bottom of the page.Composer
composer require claytoncollie/tracking-code-for-google-tag-manager
Filters
If you want to set the container ID without using the wp-admin user interface, use the filter below.
add_filter(
'tracking_code_for_google_tag_manager_id',
/**
* Set Google Tag Manager container ID.
*
* @param string $container_id Container ID.
*
* @return string
*/
function ( $container_id ) {
return 'GTM-7654321';
}
);
Contributing
While the purpose of this plugin is to be very tightly scoped, issues and pull requests are welcome, but I do not guarantee that everything will be merged or support will be given.
https://github.com/claytoncollie/tracking-code-for-google-tag-manager
