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

Screenshot of main dashboard in Tag Manager showing one account and two containers.

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.

Screenshot of a panel that says "Add a New Account" with a textbox with a label of "Account Name".

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

Screenshot of a panel that has a heading of "Container Setup" with a textbox with a label of "Container Name".

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 the workspace overview page showing a navigation along the left and navigation along top toolbar.

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.

Screenshot of a panel that says "Tags" with some text of "This container has not tags, click the "New" button to create one.".

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

Screenshot of panel that has two sections labeled "Tag Configuration" and "Triggering".

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

Screenshot of a panel that says "Choose tag type" with a list of different tags including "Google Analytics - Universal Analytics".

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 – Univeral Analytics”. Depending on the type, the next screen shows a few different settings that you can configure.

Screenshot of "Tag Configuration" panel showing "Google Analytics" as the Tag Type with settings of "Track Type" and "Google Analytics Settings".

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.

Screenshot of "Variable Configuration" panel showing variable type as "Google Analytics 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.

Screenshot of Admin page in Google Analytics showing three columns with "Property" in the middle. In the property column, "tracking code" is highlighted.

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.

Screenshot of the "Triggering" section when editing the tag that says "Choose a trigger to make this tag fire".

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

Screenshot of the triggers panel that says "Choose a trigger" with one labeled "All Pages".

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.

Screenshot of a popup that says "Install Google Tag Manager" with instructions of "Copy the code below and paste is onto every page of your website".

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.

Screenshot of the settings page for "Insert Script In Headers And Footers" with the textboxes having the code from the tag manager install popup.

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.

Screenshot of previewing tag manager on a site. Shows a small popup along the bottom that has a summary that says "Tags fired on this page".

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.

Screenshot of the submit changes panel. Shows options of "Publish and Create Version" and "Create Version" as long as textboxes for name and description.

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.