How to Add a Google Tag Manager to WordPress?
Tags: google, wordpress, tutorial, discuss
Published: 2024-02-19 12:13:22

Do you want to know how WordPress users are interacting with your site? 

WordPress can be enhanced with a Google tag manager. There are over 40% of websites on the internet that use Google tag manager. As well as offering an easy management system, it improves page loading speed as well.

This guide will show you how to add Google tag manager to your WordPress site. 

Let us understand the concept of Google Tag Manager first. 

## What is Google Tag Manager? 

With Google Tag Manager, you can manage and deploy website tags without making any code changes. 

Templates are built-in, and Google Ads, Google Analytics, and other tools are integrated. It even allows you to test the tags or triggers before they are published in preview mode.

Steps for Setting Up Google Tag Manager in WordPress 

Google Tag Manager can be added to WordPress in two ways. The first is done manually, and the second is done with a plugin. As there is more scope for customization, it is recommended to use the manual method. 

## Creating a Google Tag Manager Account 

- Firstly, you need to have a Google Tag account. For this visit: [https://tagmanager.google.com/](https://tagmanager.google.com/)

- Google Tag Manager homepage will appear. Here, click on, Create Account.
 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/13dbt3vxrols26k49m1y.png)

- You will now need to enter the Account name and Country in the Account Setup section.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jt7xeog2kwr0ke6a9p1y.png)

- Choose web as the targeted platform in the Container Setup section. Click "Create" once you have filled out all the required information.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tp59tg1y2oqnfmrdfwve.png)

- Clicking Create will take you to the TOS page. You must read all the information and check the box "I also accept the Data Processing Terms as required by GDPR."


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2x7vtmz0yrzzuk2kahoc.png)

- Then, on the upper right side, click on “Yes”.

- You will now see a popup window containing two codes. WordPress has two sections: a header section and a body section.

- Copy both of these codes using the snippets.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0km23i7hgg9o6m3q0fk1.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y309wmvbwkmr8wfqx1kq.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iy8ng2aolqnb96cpxk5y.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5wdogm5l9c42frw7scdn.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a57ki4spa3xop80s651f.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/68tu9hc90q4oium298qj.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vww6isjjnt2umyxss0j6.png)

## Conclusion

With Google tag manager, you can track the user's activity on your website. Google tag manager is very important if you have a business-focused website.

I hope you found this article useful in understanding how to add a Google Tag Manager to your WordPress website.