blog

Google Tag Manager for Beginners: How to Use Tags and Triggers to Setup GTM

If you're new to website tracking and marketing, Google Tag Manager (GTM) might sound a bit daunting. But don't worry! This guide is designed to help beginners understand what GTM is and how to use tags and triggers effectively. By the end of this post, you'll know how to set up a simple tag and trigger, and understand why GTM is an essential tool for your website.

What is Google Tag Manager?

Google Tag Manager is a free tool that allows you to manage and deploy marketing tags (snippets of code or tracking pixels) on your website without modifying the code directly. Think of it as a container that holds all your tracking codes in one place, making it easier to manage and update them.

Basic Definitions: Tags and Triggers

Before we dive in, let's clarify some basic terms:

  • Tags: These are snippets of code that tell GTM what to do. For example, a Google Analytics tag sends data about your website traffic to your Google Analytics account.

  • Triggers: These define when a tag should fire. They listen for certain events like page views, clicks, or form submissions.

In simple terms, tags are actions, and triggers are conditions that determine when those actions should happen.

Step-by-Step Guide: Setting Up a Simple Tag and Trigger

Let's walk through setting up a basic Google Analytics tag that tracks page views on your website.

Step 1: Create a Google Tag Manager Account

  1. Go to Google Tag Manager and sign in with your Google account.

  2. Click on "Create Account".

  3. Enter your Account Name (usually your company name).

  4. Set up a Container for your website by entering your website's domain.

  5. Choose "Web" as the target platform and click "Create".

  6. Accept the terms of service.

Step 2: Install GTM on Your Website

  1. After creating the container, you'll receive two pieces of code.

  2. Copy the first code snippet and paste it into the <head> section of your website's HTML.

  3. Copy the second code snippet and paste it immediately after the opening <body> tag.

  4. Save and publish your website changes.

Step 3: Create a Google Analytics Tag

  1. In your GTM workspace, click on "Tags" in the left-hand menu.

  2. Click "New" to create a new tag.

  3. Click on "Tag Configuration" and select "Google Analytics: Universal Analytics".

  4. Set the Track Type to "Page View".

  5. Under "Google Analytics Settings", select "New Variable...".

  6. Enter your Google Analytics Tracking ID (you can find this in your Google Analytics account under Admin > Property Settings).

  7. Click "Save" to create the variable.

Step 4: Set Up a Trigger

  1. Under your tag settings, click on "Triggering".

  2. Select the "All Pages" trigger (this means the tag will fire on all page views).

  3. Click "Save" to finish setting up the tag.

Step 5: Test and Publish

  1. Click on "Preview" in the top right corner to enter the preview mode.

  2. Open your website in a new tab to test if the tag is firing correctly.

  3. In the GTM preview panel, you should see that the Google Analytics tag has fired.

  4. If everything looks good, go back to GTM and click "Submit", then "Publish" to make your changes live.

Real-World Examples

  • E-commerce Tracking: An online store can use GTM to track purchases by setting up tags that fire when a purchase is completed.

  • Form Submissions: A business website can track contact form submissions by creating a trigger that listens for form submission events.

  • Button Clicks: If you have a downloadable PDF, you can set up a tag to track how many users click the download button.

Why Google Tag Manager is Important for Website Tracking and Marketing

Google Tag Manager simplifies the process of adding and updating tags on your website, saving you time and reducing the need for a developer. It allows you to:

  • Improve Accuracy: Centralized management reduces errors from manual code edits.

  • Enhance Flexibility: Quickly add or remove tags to support new marketing strategies.

  • Boost Performance: Asynchronous tag loading helps your website load faster.

By understanding how to use tags and triggers in GTM, you gain valuable insights into user behavior, which can inform your marketing decisions and help grow your business.