How to install Google Tag Manager to WordPress site

What is Google Tag Manager? Google Tag Manager is a free tool that allows you to manage and deploy marketing tags (snippets of code or tracking pixels) on the website (or mobile app) without always having to edit the code of the website.

What’s the goal? Install Google Tag Manager on WordPress website.

Why does it matter? Google Tag Manager makes it easier for marketers to implement tags or tracking pixels without having to rely on web developers to do it for them.

What’s the result? Successfully launch Google Tag Manager on website.

When do you do this? After you install WordPress, but also after every theme change.

Any special requirements? This process only applies to WordPress sites.

Who should do it? The person is responsible for managing website.

Where this is done? In WordPress Dashboard and Google Tag Manager.

How long will this take? about 5 minutes

Now let’s add some code to WordPress website.

Content Summary

Environment setup
Create a Google Tag Manager Account & Generate Tag
Adding Google Tag Manager to WordPress website
Checking if you install Google Tag Manager correctly

Environment setup

Create a Google Tag Manager Account & Generate Tag

Step 1: Go to Google Tag Manager.

Step 2: Press Start for free and sign-in with Google Account (or create one).

Press Start for free and sign-in with your Google Account (or create one).

Step 3: Click on Create Account.

Click on Create Account.

Step 4: Then you should see the tab below called Add a New Account.

Then you should see the tab below called Add a New Account.

Step 5: Add a name to the account (Eg: Company Name) and choose country.

Step 6: You can decide if You want to share your data with Google (click on “?” for more info).

You can decide if You want to share your data with Google (click on “?” for more info).

Step 7: In the Container Setup tab choose a name for container (Eg: www.mysite.com).

Step 8: Choose the target platform – in case of Website it will be WEB.

Step 9: Click on Create.

Step 10: Read & Accept Google Tag Manager Terms of Service Agreement and click on Yes.

Read & Accept Google Tag Manager Terms of Service Agreement and click on Yes.

Step 11: You are now in Google Tag Manager Dashboard Tag Manager, and the next step is to go the Admin tab section.

You are now in your Google Tag Manager Dashboard Tag Manager, and the next step is to go the Admin tab section.

Step 12: Click Install Google Tag Manager.

Click Install Google Tag Manager.

Step 13: There you can see the code that you need to install on the website.

There you can see the code that you need to install on your website.

Adding Google Tag Manager to WordPress website

Step 14: Log in to WordPress Admin Area: (Eg: yourblogdomain.com/wp-admin or yourblogdomain.com/wp-login.php).

Log in to your WordPress Admin Area: (Eg: yourblogdomain.com/wp-admin or yourblogdomain.com/wp-login.php).

Step 15: After you log in, go to Dashboard > Appearance > Theme Editor.

You are now in the Theme Editor section of your WordPress Blog, where you see the actual source code of your Theme.

Step 17: The next step is to find the HEADER of theme, this is the piece of code that is loading first on each page of the website, and that’s the file we want to edit to place the code that will fire on each page of WordPress Blog.

Step 18: In the Theme Editor, head to the right side and select Theme Header (header.php). If you don’t find it, you can press “CTRL-F” to search and find it more easily.

In the Theme Editor, head to the right side and select Theme Header (header.php).

Step 19: Press Ctrl+F (it will open searching console) and search for <hea.

Press Ctrl+F (it will open searching console) and search for “<hea”.

Step 20: This will highlight the place you will use in the next step.

This will highlight the place you will use in the next step.

Step 21: Go back to Google Tag Manager tab on Chrome Browser.

Go back to Google Tag Manager tab on your Chrome Browser.

Step 22: Head to code you revealed before in Admin – Install Google Tag Manager.

Head to code you revealed before in Admin - Install Google Tag Manager.

Step 23: Select and copy the first part of the code – NOTICE THAT Google highlights that you should paste this code as high in the <head> of the page as possible, this is very important as the higher the TAG is, the faster it will load / fire on website.

Step 24: Simply paste the code in the Theme Editor just underneath the <head>.

Press Ctrl+F on your keyboard and search for<body.

Step 27: Locate the <body> opening.

Paste second code right underneath it.

Step 29: Click on Update File at the bottom of the page.

Click on Update File at the bottom of the page.

Step 30: Now you should see that File edited successfully.

Now you should see that File edited successfully.

Checking if you install Google Tag Manager correctly

Step 31: Install Tag Assistant (by Google) Chrome Extension.

Step 32: After installation, click on the Tag Assistant icons on Chrome Browser.

After installation, click on the Tag Assistant icons on your Chrome Browser.

Step 33: Click Enable it.

Click Enable it.

Step 34: Now you should see all working tags or if they encounter any problems. In the screenshot below, it’s in Yellow because our Google Tag Manager container is empty.

Now you should see all your working tags or if they encounter any problems. In the screenshot below, it’s in Yellow because our Google Tag Manager container is empty.

This is it! You installed Google Tag Manager on the WordPress website. You are now ready for adding more Tags & Tracking Pixels to the site. GTM will make it easier for you!