Update time: June 5, 2025
This article introduces how to install Google Tag Manager on WordPress, in GTM, click「Admin」——「Install Google Tag Manager」:
The code has two paragraphs, need to be installed on all pages of the website, usually installed on the template page, one that needs to be deployed to the header, and one that needs to be deployed to the body.
Source Code
Find the template page:
Read More:Install Google Tag Manager on Your Website
Theme File Editor
In the WordPress backend, click「Themes」——「Theme File Editor」,find header.php, install the code before the header:
Plugins
Search for GTM in Plugins, you will find:
- GTM4WP – A Google Tag Manager (GTM) plugin for WordPress
- GTM Kit – Google Tag Manager & GA4 integration
- Google Analytics and Google Tag Manager
There are many plugins. After installation, just configure the container ID.