• September 22

How to Install and Setup Google Tag Manager in WordPress

Because WordPress is the most popular CMS for blogging, today you will get an instruction how to add Google Tag Manager into any WordPress themes.

You must first register on the site Google Tag Manager or use to enter account information Google, if you already have. Login and registration are carried out here. After registration (or login), go to the list of accounts, you can do so by clicking in the upper left corner.

Create an account in Google Tag Manager to add one to your WooCommerce themes


  • Then you need to create a new account by clicking on the “New Account”.
  • The account creation form will open within Google Tag Manager. In the first step you must specify the name of the account, decide to transfer (or not) the data to Google and other services, and click on the “Next” button.
  • The second step involves the creation of a container, which will contain all the tags that you will create later setting up Google Tag Manager.
  • Enter the name of the container, select the “Web Page” as a place where it will be used, set the time zone and click on the “Create account and container”.
  • After that, if you do not make any mistakes, will appear with the agreement on the use of Manager tags Google (Google Tag Manager), select the language to become familiar with its contents and accept or reject it by pressing the appropriate button below it.
  • If you have agreed to the terms of the agreement, it will open a window where the generated code is a container to be placed on the website.

Adding Google Tag Manager to WordPress themes

Since our objective is only to install Google Tag Manager to the site runs on WordPress, click the bottom button “Add tags later”. On this account creation and Google Tag Manger of the container is completed, it is now necessary to integrate the tool on the site.


Go to the control panel of your blog. Important! You must have the right to edit the file themes of the blog. Select the menu item “Appearance -> Editor”. In the window on the right, select the file “header (header.php)”.

Open the page on which will be seen the source code of the selected file without closing the current browser tab to the source file header.php, go to Google Tag Manager.

Choose from a list of accounts that you created earlier. After that, go to the settings of the container:

The major settings of Google Tag Manager for WooCommerce templates
In the window that we are interested in the code to be added to the file header.php, it is located at the bottom of the window. Copy this code.
Then go to the browser tab in which you opened for editing the file header.php. Find it in the opening <body> tag and paste the code of Google Tag Manager immediately after this action.


The code is in the header.php file system. Then save your changes by clicking on “Update file”. The installation of Google Tag Manager in WordPress themes is now completed. You can check the results by going to your blog and then you need to refresh the page by pressing F5 and view its source code.

If you see there after the <body> tag CTID that means Google Tag Manager, then everything is done correctly and you can begin to set up Google Tag Manager. The fact that you can do more, you can learn from the support service or forum of our website where any problems with WordPress themes are discussed.

This site use cookies
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.
Nope... I Am on a diet