Getting Started With Google Tag Manager

Screenshot of main workspace overview.

This post will take 10 minutes to read.

As you grow and market your websites, you tend to add more 3rd-party scripts on your site for assisting with marketing. Some scripts may be for tracking conversions and advertising such as Google Analytics, Facebook pixel, Quora Pixel, and HotJar.

As you add more of these types of scripts or “tags”, it can be a bit technical in adding these to your site or making changes. Additionally, if you have multiple people working on marketing, it may be challenging to manage the changes everyone is making. This is where the concept of a “tag manager” comes in.

What is Google Tag Manager?

A tag manager is a service that allows you to add various new scripts and pixels to your site using an interface instead of having to manipulate the code. Additionally, most tag managers will enable you to have different people working on configurations and settings at the same time.

Google Tag Manager is a great way to manage your site's pixels and tags. Click To Tweet

Google Tag Manager is Google’s answer to this problem and is part of their marketing platform. Another service you may have come across is Segment.

What makes Google Tag Manager a great place to get started is because it is both free and easy to set up. It even has a quick set up to integrate some of their other products, such as Google Analytics, that you may use.

The Basics

Before we can create our account and get our tags set up, we need to review some of the concepts and terms used throughout Google Tag Manager.

Account

If you have used other Google marketing products, such as Google Analytics or Google Ads, you may have come across this before. It is important to point out that the “account” is not your Google Account. Many Google Accounts can be associated with accounts in Google Tag Manager, and you can have multiple accounts in your one Google Account.

For example, you may be using Google Tag Manager for multiple clients or even numerous businesses that you manage. You could have separate Google Tag Manager accounts for each of these.

Container

Inside each of your accounts, you can have multiple “containers”. This is similar to the “properties” in Google Analytics. Each container can represent a different site within the account. So, if your business has two separate sites, you may have one account with two containers in it.

Workspace

Inside your containers, you can have multiple workspaces. If you are the only person managing the tags and you do not make a lot of changes, you may just use only the “Default Workspace”. However, maybe you had someone else who was working with you. This other person may be testing out new tags at the same time you are.

You could have separate workspaces for each of you. Each workspace would allow each of you to make changes without affecting the other. Then, once one of you are ready, you could “publish” your changes to the site. The other person just updates their workspace to see your changes.

Tags

The “tags” are the main focus within Google Tag Manager. Each tag you create will have some configuration about how it gets triggered and what data to send to which service. You can have many different tags and even group them inside folders for organization.

Triggers

For each tag you create, you will specify what “triggers” the action. In many cases, you may use the default “page view” trigger. This would mean that the tag completes the action on every page of your site when it is loaded. This trigger is used with Google Analytics and other pixels you may add.

Some custom triggers may include when a site visitors plays a YouTube video or submits a form. These triggers would then cause certain tags to complete an action.

Variables

Depending on your tags, you may have a variety of different “variables” or custom data that you want to send to your various services. One example may be the name of the video the visitor played. Another example will be your settings for your Google Analytics and its tracking ID.

Setting Up Google Tag Manager

Now that you have some basic understanding of the concepts, it’s time to create your first container. If you haven’t already, sign into Google Tag Manager.

Then, create your first account. If you are just using the product for your own business, you can name the account after your business.

Next, you will create your first container. Copy in your website’s URL and then click create.

Once created, you should be directed to the default workspace of the container. If not, click on your container from the main dashboard.

Screenshot of main workspace overview.

Inside your workspace, you will see a menu along the left sidebar. The first item will be which workspace you are in. For now, you can stay in the default workspace. If you add new people to your team, you may want to look more into adding other workspaces.

As you make changes within your workspace, these changes will be saved but not published onto your site. After you make changes and you are ready for them to be on your site, you will click the blue “Submit” in the top-right corner. Before we do that, let’s create your first tag.

Creating Your First Tag

In most cases, the very first tag you will add is Google Analytics. So, let’s walk through how that process works. First, click “Tags” in the left sidebar.

When you first start, this screen will be empty. Over time, you may have dozens of different tags here. To get started with our first one, click on “New”.

A new panel will appear. You can name each tag whatever you choose, but I recommend being descriptive so you can find it later. For this one, I will call it “Google Analytics”. The next step when setting up your tags is filling in the configuration. Click on “Tag Configuration”.

Another new panel will appear. In this panel, you can choose which type of tag you are configuring. There are many built-in integrations that you choose from including Google Analytics, Google Optimize, Crazy Egg, Twitter Website Tag, and more. For now, click on “Google Analytics – Universal Analytics”. Depending on the type, the next screen shows a few different settings that you can configure.

For this first Google Analytics tag, you will want to leave the “Track Type” as “Page View”. If you click on the drop-down for the “Google Analytics Settings”, you can click on “New Variable” to set up our tracking ID and settings.

This will be your first custom variable. You can name it whatever you wish, but I would suggest something such as “Google Analytics Settings”. There are a lot of settings you can configure for Google Analytics by clicking the “More Settings” link.

However, we will keep the defaults for now. The only thing we need to do is copy in our tracking ID. If you go to the admin area within Google Analytics, you can go to the property you want to send data to from this container’s site.

For example, you may have a container for example.com, and in Google Analytics, you should have a property set up for example.com. So, you will want to go to that property and click on “Tracking Information”. In the menu that appears, click on “Tracking Code”.

On that page, there will be a tracking ID for this property. Copy that tracking ID and paste it back into the settings in Google Tag Manager. Finally, click save for that variable.

Now, scroll down to the “Triggering” section and click on that section.

For your first few tags, you will only have one trigger available. As you continue adding new tags and want to track more interactions, you will add a variety of triggers that will be listed here. For now, click on “Page View”.

Now that your tag has a configuration and a trigger, you can click the blue “Save” button.

Adding Google Tag Manager To Your Site

Before we can finalize our tags, we need to get the script onto our site. Depending on what software or platform you used to create your site, this may vary significantly.

The first step will be to click on the GTM-XXXXXX code along the top toolbar of your workspace. This will open a popup that looks similar to the one in the image.

You will need to add this code to your website to install Google Tag Manager. Once installed, you will be able to add new tags and pixels without needing to add new code. Some website software has an area to add code for the “head” and “body”. You will need to find those settings within your platform to add this code or give this code to your developer.

If you are using WordPress, you can use a plugin such as Insert Scripts in Headers and Footers. Using that plugin, you would copy in the code as shown in the image below and then click save.

Once you have installed the code for Google Tag Manager, be sure to remove any code for Google Analytics, if previously installed. If not, all data will be duplicated in your analytics since we are now sending that data through Google Tag Manager.

Previewing And Publishing Changes

Now that we have Google Tag Manager on our site, it’s time to finalize our changes. Along the top toolbar, you will see two buttons: “Preview” and “Submit”. If you click on “Preview” and then go to your website, you should see a popup that appears for Google Tag Manager.

This preview will allow you to see which tags are firing to make sure everything is set up correctly before making these changes live for all site visitors. In our case, we can see the Google Analytics tag was fired when I loaded the page.

Now that we are happy with the changes, go back to Google Tag Manager and click Submit.

In the new panel that opens, you can enter in a version name and description. At the bottom, you will see a list of all the changes that were made since your last version.

You could click “Create Version” without publishing. If you had multiple people working in different workspaces, this would be a way to let them see the changes without publishing to your site.

Since we are ready to add this tag to the site, we can keep the “Publish and Create Version” selected and then click “Publish”. You now have Google Tag Manager on your site and are sending data to Google Analytics!

Just to make sure, go back to Google Analytics and go to the “Realtime” page. Go to your site in a private or incognito browser. You should see your visit appear in the “Realtime” section.

Next Steps

Now that you have Google Tag Manager all set up and ready to go, you can add your other tags and pixels. Additionally, you can add new triggers and new tags to send certain events to Google Analytics. For example, you could send an event to Google Analytics when a button is clicked, a form is submitted, or a video is played.