How to Install Google Tag Manager on a WordPress Website?

Google Tag Manager WordPress is a very important element for digital marketing. According to the official Google site, Google Tag Manager is a system for tag management that helps you to quickly change and easily update codes related to traffic measurement on your website or mobile app. It’s a place where you can put all the related codes of Google analytics, Facebook pixels, etc., on your website and set commands for them individually. 

The advantage of using Google Tag Manager is that there is less code on your webpage and hence it will take less time to load. Moreover, you can change and update commands for your webpage tags easily and safely without compromising the main webpage codes. The downside of Google Tag Manager is that it only works with WordPress websites. So, to use WordPress, you must make your webpage from WordPress.org.

So now that we know about Google Tag Manager, let us look at the steps of adding google tag manager to WordPress.

How to Add Google Tag Manager to WordPress?

Before installing Google Tag Manager WordPress, you must make sure that your webpage is built in WordPress and you must have some Google Tag Manager WordPress plugins installed.

  1. Install plugins

So, first what you will need is the Google Tag Assistant Chrome Extension. It’s a free software, which helps you to validate your tag management. Then you must sign in to Google Tag Manager with your Google account.

  1. Open Google Tag Manager Account and Create Container

After signing in to Google Tag Manager for the first time, you will need to create a tag container. You can do it with your website name or any other name you desire.

How to Install Google Tag Manager on a WordPress Website?
https://developers.google.com/

In step 2 of Google Tag Manager account creation, you will need to set up the container. Simply put the link of your webpage in the container and then select the platform you want to use such as Web, Android, and IOS.

How to Install Google Tag Manager on a WordPress Website?

After clicking “Create”, Google Tag Manager will show a page with their terms and conditions. You click agree to them and your container will be created.

Immediately after the container is made, Google will show something like this.

How to Install Google Tag Manager on a WordPress Website?

This is the code of the container. One is for the head of the HTML codes and the other is for the body. This code is useful for those who are hand-coding. In this method, you need to copy these codes and paste them into all of the pages of your website. This is a new installation of the Google Tag Manager for WordPress. The previous versions did not have these separate codes for head and body. Google Tag Manager claims that by using this method, websites will load faster and the client tracking will be more accurate and productive.

But this is a little complicated and risky. One small mistake in the process can cause the whole system to fail. That is why we do not recommend you to use this method. Rather we would urge you to use the other method designed especially for WordPress websites and it’s very easy and risk-free. But we will talk about that method too. For this content, we mark that method as method 2. Now let’s talk about method 1.

So, for method 1, we cross this tab shown in the previous picture and we will have the tab that is shown in the next picture.

How to Install Google Tag Manager on a WordPress Website?

Here you can add all of the marketing pixels like Google Analytics, Facebook pixels, and other tracking pixels for your webpage. You can also set different commands for all of the pixels. This way, you create your container. Whenever we need to make any quick changes or update our marketing pixels, we do it here in the

Now after we set up the container, it’s time to publish it. To do that, press the submit button on the top right corner and you will have something like the picture shown below.container.

How to Install Google Tag Manager on a WordPress Website?

There will be options for you to write version names and their description. These are not necessary to fill in. Their purpose is to help you identify the roles of each version separately in the future for updating. So, if you want to fill them in, then take your time. After that, click publish in the top right corner.

How to Install Google Tag Manager on a WordPress Website?

Then you will have a tab giving you the option for naming the version and adding a small description. You can skip that part too.

After this, your container will be live and ready to use.

Install Google Tag Manager Plugin WordPress

Web developers often get confused and ask how to install google tag manager on WordPress. It’s simple. All you need to do is go into the dashboard of WordPress. From there, browse to plug-ins and click on Add new.

Then you will type Google Tag Manager on the search bar of the plug-in. The best Google Tag Manager plug-in is Duracell Tomi’s Google Tag Manager for WordPress. It should be the first one appearing in the search result. Install it and activate it.

How to Install Google Tag Manager on a WordPress Website?How to Install Google Tag Manager on a WordPress Website?

Set up Google Tag Manager

After activation of the plug-in, we come back to the WordPress dashboard and browse into settings. Then we click on Google Tag Manager.

How to Install Google Tag Manager on a WordPress Website?

You will be brought into a tab shown in the picture. There you will see a blank space for inserting your Google Tag Manager ID.
 How to Install Google Tag Manager on a WordPress Website?

You can easily find your Google Tag Manager ID on the top right side of the Tag Manager dashboard.

You copy this ID number to the Google Tag Manager WordPress options and select Custom as Container Code Placement and click save changes.

Now there is only one more thing left to do. In the Google Tag Manager WordPress Option tab, you will see a small snippet at the bottom. You will need to copy this snippet and paste it into the theme header of your WordPress website. It’s a one-time procedure.


How to Install Google Tag Manager on a WordPress Website?How to Install Google Tag Manager on a WordPress Website?

To do that, you copy this snippet and come back to the WordPress dashboard. There you will need to browse into the appearance and click on the editor. Make sure that you are editing the theme of the website.


How to Install Google Tag Manager on a WordPress Website?

Now you need to find the theme header. Simply browse the navigation bar on the right side of the screen and you will find the theme header. Click on it and you will be brought to the theme header code.

Now you need to paste the snippet you copied under the first body tag like the picture below.

How to Install Google Tag Manager on a WordPress Website?

After that, you simply click the update file button on the bottom of the screen. That’s it. You have installed Google Tag Manager on your WordPress website.

Now for method 2, the newly updated method of Google Tag Manager.

How to Install Google Tag Manager on a WordPress Website?

In this method, we have two HTML codes rather than one snippet. Now because of two HTML codes, the container tags will get more accessibility and Google claims that this method has increased accuracy in traffic tracking. 

Noticed the writing above? It says to copy the two HTML codes and paste them on every page. What they are saying is that you need to copy these codes and paste them into the source page. One under the head tag and one under the body tag. How do we do that? Let’s have a look.


How to Install Google Tag Manager on a WordPress Website?

Go to WordPress Editor

The first thing you need to do is open up the WordPress dashboard of your webpage. Then on the left side, you will see a black vertical navigation bar. Browse there and you will find Appearance. In the appearance section, you will find the editor. This will bring you to the source page of your webpage, filled with HTML codes for various options of the page.


How to Install Google Tag Manager on a WordPress Website?

Edit Theme

When the box said code for head and body, they meant the HTML code for the webpage theme. Different web pages have different themes. That does affect the standard procedure of this method. On the editor page, you will have a vertical navigation bar on the right side of the screen, showing options like body, theme header, theme footer, templates, pages, etc. As we are instructed to put the HTML codes in the head and the body, we will look for a Theme header. When you click the Theme header, you will see the source codes of your webpage theme header. It’s like your regular HTML codes, containing codes and body. Now you will need to copy the Google Tag Manager head code and paste it immediately under the head tag of the codes. Same for the body HTML code, paste it immediately under the body tag.

You must be fully cautious here. One simple mistake like pasting it two lines after the head or body tag will ruin the HTML codes and Google Tag Manager will not work, also your webpage may not load properly for wrong HTML codes.

To save your web page from such accidents, we would recommend you to keep two themes installed for your webpage. One is the main theme and the other is a child theme. Whenever you update your web page in WordPress, do it on the child theme. That way, if you make a mistake, your child theme may get ruined. But your main webpage theme will remain intact and you can easily develop another child theme from that main theme.

In this method of theme file editing, you have an option for using the HTML codes that you think are necessary. If your website has a particular page that you do not want to put any tagging on, then you can simply choose to avoid it. That way your webpage doesn’t have to load any extra codes and slow down.

Apply the codes on your desired pages and click update files. That’s it, your web page has now installed Google Tag Manager.

Now it’s time to check whether you have correctly implemented Google Tag Manager WordPress or not.

How to check if Google Tag Manager is working?

There are three easy ways/ methods of doing that. Let’s have a look at those methods one by one.

Method 1: Check with Google Tag Manager preview mode

In Google Tag Manager, you will see a preview button on the top right corner. Press that and your browser will be in a special state of examining your page for tags. Browse your webpage and you will see a dashboard pop-up from the bottom of the screen. That means you have correctly implemented Google Tag Manager WordPress.

Method 2: Check HTML source codes

Another way to check Google Tag Manager is to view the main HTML codes of each web page. Simply right-click on the web page and select view source code. It will bring you to the HTML codes for that page. Carefully search for the theme header HTML and look for the snippet codes to confirm Google Tag Manager’s installation.

This is a little complicated process, so it’s best to stick with the other two.

Method 3: Use Google Tag Assistant Extension

This is a Plug-in for Google Chrome which you can download for free from the Chrome Add-ons store. Simply search for Google Tag Assistant and install it. When it’s installed, go to your webpage and press the Tag Assistant icon. If Google Tag Manager is installed correctly, this extension will show that Google Tag Manager is installed and besides, it will show your Tag ID.

So, these are the three methods of checking whether you have properly installed Google Tag Manager WordPress.


Final Verdict

E-commerce is very demanding in the 21st century and the main fuel of e-commerce is customer information. The more information you have about your customers, the better you can operate and profit from your business. And to get information about your customers, you will need an efficient tracking method and Google Tag Manager is that method. So, if your WordPress website doesn’t have it installed, then you should do it right away. Simply follow the steps we discussed above. Install Google Tag Manager WordPress and see your business boom.