"Helping Businesses Create, Optimize & Grow."

Vorbly Blog


Digital Marketing Best Practices.

Learn How To Grow Your Business.


How To Setup Google Tag Manager? A Step-By-Step Guide.

Updated: Apr 6, 2018

Do you want to track customers’ behavior on your website? But don’t want to go through an agency and web developers? Then use Google Tag Manager for performance tracking and digital analytics. And the best thing, it's free!

Learn how to setup and use Google Tag Manager with our step-by-step guide.


Chapter 1: What is Google Tag Manager?

Chapter 2: Benefits of Google Tag Manager

Chapter 3: Setup Your Google Tag Manager Account

Chapter 4: Install Google Tag Manager

Chapter 5: Google Tag Manager Workspace

Chapter 6: Defining Variables

Chapter 7: Setting Up Triggers

Chapter 8: Setting Up Tags

Chapter 9: Preview & Troubleshooting

Chapter 10: Tracking & Analysis

Chapter 11: Conclusion

Chapter 1: What is Google Tag Manager?

Google Tag Manager (GTM) is a tag management platform that offers simple, reliable and integrated way to track website behavior and marketing campaigns.

Chapter 2: Benefits of Google Tag Manager

1. Flexibility. Create and update your own tags for conversion tracking, digital analytics and marketing campaigns. Set conditions to determine when a tag is triggered.

2. Fast. Developing your tags is now fast and easy. You won't have to wait for web developers to help you deploy your tracking codes.

3. Safe. With features such as error checking, security and approval workflows, get peace of mind when you upload tags to your website.

4. Scalability. Whether you are an entrepreneur or large corporation, Google Tag Manager allows you to customize workspaces, create access controls and multiple environments for testing. Both marketing and technology teams can work on the same platform and all changes can be easily integrated.

5. Integration. Google Tag Manager can trigger tags to both Google and third party analytics platforms. And installing GTM on your website or through website builders is simple and easy.

Chapter 3: Setup Your Google Tag Manager Account

Setup your Google Tag Manager account by entering your company name and website URL (Setup Container). Then accept the GTM Terms of Service to continue.

Setup Google Tag Manager Account - Enter Company Name & Website URL

Chapter 4: Install Google Tag Manager

Before you can upload any tags to your website, you need to add the Google Tag Manager code to your website's HTML code. There are several ways that you can add the GTM code, depending on the website builder used.

If you are using WordPress, Weebly and Sqaurespace, copy and paste the Google Tag Manager code under the <head> and <body> sections of your website's source code. For a more comprehensive guide, visit Google's developer website.

Install Google Tag Manager To Website

For WordPress, you can choose to install a plugin, enter your Google Tag Manager Account ID and the plugin will add the GTM code to your website.

For Wix, Go to Site Manager > Tracking & Analytics > Add Google Tag Manager. Then enter your GTM Account ID directly and Wix will add the GTM code for you. For more instructions, visit the Wix website.

Chapter 5: Google Tag Manager Workspace

Your Google Tag Manager workspace is where you can add tags, triggers, variables and organize items into folders. You can also create separate workspaces for different users (e.g. marketing and technology teams) to segregate workflows.

Google Tag Manager Workspace

New to Tag Management? We have included some definitions to help you understand how tag management works.

Tags are pieces of code that send information to analytics platforms such as Google Analytics. For example, when a visitor clicks a button, the tag is triggered and information about the event is sent to your analytics platform.

Triggers are conditions that determines when a tag is fired (information sent). For example, when a visitor performs an action on your website (e.g. clicks a button), it triggers a specific tag which will send information to your analytics platform.

Variables: Variables are dynamic values that can be included into tags and gives you the flexibility to trigger tags for a set of values. For example, a pre-defined variable "URL" can be used to define the current webpage address. Using a variable will automatically change the value (or URL) for different webpages.

Chapter 6: Defining Variables

Variables are used in triggers and tags. When used in triggers, variables define filters that specify when a tag should be fired. When used in tags, variables capture dynamic values without the need to manually change it for every tag.

Firstly, you should setup your Google Analytics ID as a variable. Otherwise you will have to copy and paste your Google Analytics ID every time you create a new tag. Follow the steps below to create the Google Analytics variable.

  1. Go to Variables

  2. User-Defined Variables: Click “NEW”

  3. Variable Type: “Google Analytics Settings”

  4. Tracking ID: <Your Google Analytics ID>

  5. Cookie Domain: "Auto"

Variable Configuration In Google Tag Manager

Next, we will setup some commonly used variables. These variables will allow you to setup tags and triggers to track button clicks, URL clicks and form submissions. Follow the steps below to create these variables.

  1. Built-In Variables: Click “CONFIGURE”

  2. Google Tag Manager will provide a set of commonly used, predefined variables.

  3. Select "Click ID”, “Click URL”, “Form ID

Adding Built-In Variables In Google Tag Manager

Chapter 7: Setting Up Triggers

Triggers allow you to determine the conditions that will result in a tag being fired. With the various options and settings available in Google Tag Manager, the possibilities are endless.

For example, you can trigger a tag every time someone clicks on any link or only for a specific website URL.

In this guide, we will focus on three commonly used triggers, 1) Click URLs, 2) Click Buttons and 3) Submit Forms.

Click URLs

  1. Go to Triggers

  2. Trigger Name: “Outbound Link”

  3. Trigger Type: “Click – Just Links”

  4. Trigger Fires On: “Some Link Clicks” to track clicks to a specific URL

  5. Conditions: Select “Click URL”, “equals” and input <Website URL>. In this example, we want to track all outbound website traffic to www.google.com.

Adding Triggers For URLs Clicked. Note: You can also track URLs that “contains” or “starts with” a certain domain name.

Click Buttons

  1. Go to Triggers

  2. Trigger Name: “Button Click”

  3. Trigger Type: “Click – All Elements”

  4. Trigger Fires On: “Some Clicks” to track clicks for a specific button

  5. Conditions: Select “Click ID”, “equals” and input <Button ID>. Refer to Chapter 8 for instructions on how to identify your "Button ID" or "Click ID".

Adding Triggers For Buttons Clicked. Note: You can also track clicks from elements that “contains” or “starts with” a certain ID.

Submit Forms

  1. Go to Triggers

  2. Trigger Name: “Form Submitted”

  3. Trigger Type: “Form Submission”

  4. Trigger Fires On: “Some Forms” to track specific forms submitted. You can select “All Forms” if you want to track all form submissions.

  5. Conditions: Select “Form ID”, “equals” and input <Your Form ID>. Refer to Chapter 8 for instructions on how to identify your "Form ID".

  6. How To Use “Wait for Tags”? This option is useful when your form submission directs visitors to a new page. Delaying the form submission will allow tags to be fired before visitors are redirected to another page. However, you should be aware that a delay can affect user experience.

Adding Triggers For Form Submissions. Note: You can also track clicks from elements that “contains” or “starts with” a certain ID.

Chapter 8: Setting Up Tags

Setup tags to track website activity and send information to your Google Analytics account.

We will use "Button Clicked" as an example for setting up tags. For other triggers like URL clicked and forms submitted, the steps are similar.

  1. Go to Tags

  2. Tag Type: “Universal Analytics”.

  3. Track Type: Select “Event”.

  4. Category: <Your Category> for example, "Buttons” or “Promotions”

  5. Action: <Your Action> for example, “Button Clicked” or “URL Clicked”

  6. Label: “Click ID” (or “Click URL” & "Form ID”)

  7. Google Analytics Setting: {{Your Website}}. We created this variable earlier in Chapter 5 under user-defined variables for your Google Analytics ID.

  8. Triggering: Select the trigger we created earlier, “Button Click”. When the specific button is clicked, the tag will fire and event will be recorded in Google Analytics.

Setup Tags In Google Tag Manager

Chapter 9: Preview & Troubleshooting

Now that you have successfully created a tag for your button, we will test it out in preview mode. DO NOT publish (or submit) before you have verified that your tags work.

  1. Click “PREVIEW”. You will see a message telling you that you are in preview mode.

  2. Go to Your Website. A Google Tag Manager window will appear at the bottom of your browser.

Preview & Troubleshoot In Google Tag Manager

When you first load your website, you will notice that the “Button Click” tag has not been fired. This is because the specific button has not be clicked yet.

Check Tags Status On Website

After you click the button, you will see that “Button Click” tag has been fired. This means that the event information has been sent to your Google Analytics account.

Check Tags Status On Website

Now, go to your Google Analytics Account to ensure that the event has been successfully recorded by Google Analytics. You should see an event triggered under the real-time section of your dashboard. Other information like event category are recorded as well.

Check Event Trigger In Google Analytics

If you can't see the event trigger, go back to your Google Tag Manager and check your "Button ID" or "Click ID" to ensure you have selected the correct button.

How To Find Your Click ID?

  1. Go to the Google Tag Manager Preview Window on your website

  2. Click on the “Variables” tab

  3. In this example, the Click ID is “comp-jay2aksblabel”

  4. Copy and paste the Click ID to your triggers

Finding Element Click ID & Form ID.

Chapter 10: Tracking & Analysis

Once you have setup your tags in Google Tag Manager, every time your tags are fired, you will see the event in your Google Analytics dashboard.

How To Analyze Event Triggers in Google Analytics? Go to Google Analytics > Behavior > Events and you will see all the events triggered. Start tracking your sales conversions, sign-ups, subscriptions and marketing campaigns today!

Use Google Analytics To Analyze Event Triggers

Chapter 11: Conclusion

In the fast-paced world of digital analytics and sophisticated marketing campaigns, Google Tag Manager is revolutionizing campaign tracking and data analytics.

Google Tag Manager enables both large and small businesses to track marketing campaigns and sales conversions with a simple, easy-to-use and integrated solution. Gone are the days when marketers have to wait for their agencies to create tracking codes and web developers to implement those tracking codes.

Vorbly | Marketing Made Easy

Digital Marketing Solutions For Small Businesses

Recommended Article:

A Beginner's Guide To Search Engine Marketing