Skip to Content

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.

After you log in, go to Dashboard/> Appearance > Theme Editor.” width=”948″ height=”1152″></p><p>Step 16: You are now in the <strong>Theme Editor</strong> section of WordPress Blog, where you see the actual source code of the Theme (the guts of the website). But don’t be scared, we are guiding you step by step on how to add Google Tag Manager code there.</p><p>On the left side, you see the code of one page of the theme (in HTML language); On the right side, you see the menu to access the various files that compose them.</p><p><img loading=

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>.

Simply paste the code in the Theme Editor just underneath the <head/>.” width=”1920″ height=”1244″></p><p>Step 25: Go back to the <strong>Google Tag Manager</strong> tab and copy the second part of code – this time you should paste this code immediately after the opening <strong><body></strong> tag in <strong>Theme Editor</strong>.</p><p><img decoding=

Step 27: Locate the <body> opening.

Locate the <body/> opening.” width=”1118″ height=”350″></p><p>Step 28: Paste the second code right underneath it.</p><p><img loading=

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!

Alex Lim is a certified IT Technical Support Architect with over 15 years of experience in designing, implementing, and troubleshooting complex IT systems and networks. He has worked for leading IT companies, such as Microsoft, IBM, and Cisco, providing technical support and solutions to clients across various industries and sectors. Alex has a bachelor’s degree in computer science from the National University of Singapore and a master’s degree in information security from the Massachusetts Institute of Technology. He is also the author of several best-selling books on IT technical support, such as The IT Technical Support Handbook and Troubleshooting IT Systems and Networks. Alex lives in Bandar, Johore, Malaysia with his wife and two chilrdren. You can reach him at [email protected] or follow him on Website | Twitter | Facebook

    Ads Blocker Image Powered by Code Help Pro

    Your Support Matters...

    We run an independent site that is committed to delivering valuable content, but it comes with its challenges. Many of our readers use ad blockers, causing our advertising revenue to decline. Unlike some websites, we have not implemented paywalls to restrict access. Your support can make a significant difference. If you find this website useful and choose to support us, it would greatly secure our future. We appreciate your help. If you are currently using an ad blocker, please consider disabling it for our site. Thank you for your understanding and support.