Google Tag Manager (GTM) Installation On a Website

Often website owners need to add multiple code snippets to track their conversions, traffic, and gather other analytical data. With Google Tag Manager you can easily add and manage all of these scripts from a single dashboard.

There are built-in tag templates for Google Analytics, Adwords, DoubleClick, etc. Tag manager also works with several third-party analytics and tracking platforms.Apart from that, you can use custom HTML to add your own tracking or any other code that you want to add.

Follow this link to know about Google Tag Manager

This saves you the time of adding and removing tags from your code and rather manage it from an easy dashboard. Not to mention, all of these scripts are loaded in one script.

If you already have a Google Account, it’s very easy to create and install Google Tag Manager (GTM) on your WordPress website. This guide will walk you through the steps to create your own GTM Account, enabling you to add tags to your website in a matter of minutes.

Let’s get started.

If you have already created a GTM account then you can skip to step 6 for the installation part.

Step 1. Create an Account

Once you’re logged into GTM, the primary step is to make associate account. this might be helpful if you’re handling GTM implementations for multiple shoppers, as a result of you’ll need associate account for every one of them.

The account will hold the GTM container ID for your site. You have to choose the type of container (Web, iOS or Android) and hit the “create” button. That will give you the GTM code.

Note: The Google Tag Manager snippet must be placed directly in the page that you intend on tracking. Placing it in a hidden iframe or deploying it within another tag management system will prevent certain tags from accurately tracking the parent page.

I created a container using my domain name so I could easily identify the site. If I wanted to add another container (say for a mobile app for my site), I could add this via the account page.

Step 2. Create a Tag

Next, you need to create a tag. Click the “new tag” button, then select the tag you want to add.

Step 3. Add your Tracking Id

Next, find your tracking ID for the site in your Google Analytics account. Go to the admin section, select the property, click on tracking info, then tracking code. The analytics ID will be at the top of the page. Copy this and paste it into the appropriate box in GTM.

Step 4. Choose what and where to track

Next, decide what you want to track. For an analytics implementation, this will usually be page views, to replicate what your existing analytics code is doing. At this stage, you can also decide where the tag should fire. Again, for analytics, use “all pages”. Hit the “create” button.

Step 5: Preview and publish

When your site is ready, it’s time to put GTM to work. You have the choice to publish the code immediately or to preview it first. Previewing allows you to check whether the tag is firing.

When you are happy that your tags are working, hit “publish” and the code will be live. Google Tag Manager keeps track of tags, triggers, and variables. Whenever you add something new, it creates a new version for you to work on. You can also see in the dashboard when you have unpublished changes.

6. GTM Installation on a WordPress Site

You probably know that Google Tag Manager is a great and free way to manage all of the tracking code needed on your website.
Fortunately, it is not that hard. You can get it done in less than 10 minutes. Here’s how

a – Create a Google Tag Manager Account and a Container for your Website

As we already Completed setup of GTM account so we will directly jump to container part.

Once your container is set up, open it and click on the Admin tab to enter the administration area for your container. Click on the gear symbol next to “Install Google Tag Manager”.

This will bring up a code snippet that you are going to cut and paste into WordPress.

b – Installation

There are two ways to install GTM. One is to use a use a plugin to install GTM (recommended as it the fastest and safest to get started with) – here is the WordPress pugin we recommend –

Activate the plugin and follow the steps mentioned in it and you are good to go!

To install GTM with the code follow the following steps – 

To install Google Tag Manager with the code in theme files, you are going to copy and paste that code snippet into WordPress. Specifically, you are going to paste it into the correct file in the WordPress Theme that your website is using.

Note that if you are using a 3rd party theme (e.g., a theme that you purchased), in order to preserve compatibility with future upgrades, you may not want to edit your theme directly. In this case you should
modify your theme using a child theme. In either case, the process of pasting in the co snippet is similar.

To get started, log in to WordPress and navigate to Appearance > Editor

In the upper right corner, where it says “Select theme to edit”, make sure you have selected the active theme for your website.

If you are not sure which theme is active, click on “Themes” in the left hand navigation bar, and see which of the installed Themes is highlighted.

Next, in the right-hand column, under Templates, click on the appropriate header file. By default, this will be “Header” (header.php).

However, the theme may be using a different file, depending on how the developers have customized it. Assuming your active header file is header.php, click on this link in the right side column.

The text editor in the center of the page now contains the header.php file. Scroll down until you find the opening tag. Then, paste in the GTM code snippet right below that tag.

Once you’ve inserted the snippet, make sure you scroll to the bottom of the page and click on the “Update File” button to save your changes.

Step 3 – Testing that GTM is Correctly Installed or not

Next, we are going to use Tag Assistant (by Google) to make sure that Google Tag Manager is installed correctly. For this, you will need to use the Google Chrome Browser. So, if you don’t have Chrome, install it on your computer now.

Open the Chrome browser, and install Tag Assistant. Once Tag Assistant is installed, simply navigate to a page on your site, and click on the tag icon at the top of your browser. You should see a face tag labeled “Google Tag Manager” indicating that GTM has been successfully installed.

Final Thought

Now that you have Google Tag Manager installed, you can use it for installing all kinds of tracking tags like Google Analytics, Google AdWords, AdRoll, CrazyEgg, and more.

Congrats on reaching the end of this post. At this stage, you should have created a GTM Account, created and installed your GTM Container and checked it’s on your website on WordPress site. You’ll be ready to add your very first tag.

Thanks for reading our guide, we hope you found it useful. Don’t hesitate to add a comment or mail us if you have questions, or need some support with GTM.

Yatindra Sahu

Data Enthusiast


Leave a Reply