View Categories

How to Install and Set Up Google Tag Manager on WordPress

Google on a tablet
  • Oct 21, 2021
  • 0
  • by Sarojini Nagappan

If you’re looking for Google Tag Manager, there’s a good chance you have Google Analytics up and running on your WordPress site by now. If you don’t have Google Analytics on your site, take a look at this article on How to use Google Analytics with WordPress and get it installed on your WordPress site before starting with Google Tag Manager. Once you’ve done that keep reading our blog to learn how to install it and set it up on your site!

Why is Google Tag Manager Right for You?

Google Tag Manager is a great tool for any website owner. Google Tag Manager (GTM) allows you to manage code script, track conversion, and efficiently use a single dashboard. It comes with templates for Google Analytics, Adwords, and works well with some tracking platforms. Any edits to scripts can be done via GTM and then applied to the whole site.

Installing and Setting Up Google Tag Manager for WordPress

To begin, you must have a google analytics account before you proceed with the Google Tag Manager installation. If you don’t, go to the Google Tag Manager website and sign up using the same Google account you used with Google Analytics.

Follow these steps to install and setup Google Tag Manager:

1. Sign up for the Google Tag Manager using the same account used for the Google Analytics account.

2. On the create new account page, give a name for your account and click on the continue button.

3. Give an account name, container name, choose the target platform, and click on the create button to create a container. You can have multiple containers in one account:Add account page on WordPress4. Next you will be redirected to the container dashboard:

Google Tag Manager

5. Once you have created a container, the next step is to create a tag.

Creating Page View Tag on Google Tag Manager 

Now we will show you how to create a new Page View Tag. Follow these steps:

  1. On the dashboard, click on New Tag:

Adding new tag

2. Give a name for the tag, and then click on the Tag Configuration section, to choose the tag type:

Naming the tag

3. Choose the tag type. For this blog, we will use the Google Analytics: Universal Analytics

Google Analytics: Universal analytics

4. Next step is to configure the tag. On the Tag Configuration screen, check the “Enable overriding settings in this tag” option. Get the Tracking ID code from your Google Analytics account and paste it into the Tracking ID.

Configuring your tag

5. A tracking ID is a special code that allows Google to identify your site. Login into your Google Analytics account, under the admin tab, copy the tracking ID from the tracking info.

6. Next on the Trigger section, choose the trigger type. Here we will choose the Page View trigger for All Pages:

Choosing the trigger type

Trigger type

7. Click on Save after you enter your tracking ID. You should see the tag on your dashboard:

Looking at the tag on your dashboard

Adding Tag Manager Code in WordPress

1. To begin, click on the GTM ID on the top navigation bar to retrieve the GTM code. Edit the header.php template and paste the code right after <body> tag.

Adding the tag manager code

Installing google tag manager

2. Alternatively, you can use Insert Headers and Footers plugin and use it to paste the GTM code.

3. The final step to complete this Google Tag Manager setup is to use the Google Tag Manager dashboard to publish the container.

Conclusion

There are many different ways to install and configure the Google Tag Manager for WordPress. This blog showed you how to set up the Google Tag Manager and create a page view tag. Google Tag Manager has many useful integrations. Visit the Google Tag Manager page to get more information. 

Looking for great hosting for your WordPress site? Look no further! With A2 Hosting’s Managed WordPress plans you can get 24/7/365 support, 99.9% uptime, and all the tools you need to better manage your WordPress website. Contact our sales team today with any questions!

Related Resources:

How to use Google Analytics with WordPress

Using Google Analytics & WordPress

How to Integrate Google Analytics With WordPress (In 3 Steps)