Getting Started with Google Tag Manager

Getting Started with Google Tag Manager

If you’re looking to gather more insight into how your visitors are interacting with your website but aren’t quite sure about the proper way of collecting such data, you’ve come to the right place. 

Google Tag Manager is a feature rich, user friendly way to enhance the data collected from your website visitors. Integrating Google Tag Manager with your website isn’t too difficult, but some basic knowledge of Google Analytics and how to edit files on your website will make the process much more painless.

Before we take a look at the steps to get started with Google Tag Manager (GTM), let’s understand why we might choose to use GTM instead of Google Analytics.

First off, if you’re doing any type of marketing you may be used to relying on a developer to install various tracking codes, make changes to existing codes and the like. With GTM that all becomes very, very easy. You can easily manage Google Analytics, Adwords and other third-party tracking tags through the various tag types available in GTM.

Need to track the number of clicks on your new “Buy Now” button or how many prospects are filling out your inquiry form? No problem, you can do all that by setting up tags through GTM without the need to rely on a third-party. You can track these conversions as Google Analytics events and set up goals that show conversions on these events.

These are just some basic examples of how you can benefit implementing GTM on your website. Things can get much more complex depending on the type of site you’re working with and the metrics you’d like to track.

Integrating Google Tag Manager with Your Website

Let’s take a look at how to integrate Google Tag Manager on a new website. This guide assumes that you’ve already set up a Google Analytics property for your website, but haven’t inserted the usual Google Analytics tracking code.

Now then, let’s take a look at the first step:

1. Google Tag Manager Initial Setup

You’ll need to head over to Google Tag Manager and sign in. Create an account for the website you’re going to be integrating with. You’ll need to input some basic information about the site you’ll be using this container on, in the “container settings” section under the admin menu. You’ll also need to add the code from the “Install GTM” page to your website immediately after the openingtag.

Also read: Finding the Best Company to Run Email Marketing Campaigns

2. Creating the Basic Tags

Let’s create a few basic tags that will be used for tracking analytics and clicks.

First click the container name and then the “New” button on the “Tags” tab. You’ll be required to provide a tag name, tag type, Google Analytics tracking ID, track type and firing rules.

  • Tag Name: Page Views
  • Tag Type: Universal Analytics
  • Tracking ID: Your Google Analytics tracking code for the property.
  • Track Type: Page View
  • Firing Rules: Fire on all pages
Getting Started with Google Tag Manager

Fire on all pages:

Getting Started with Google Tag Manager

This will record page views just like the normal Google Analytics code would.

Next, create a new tag that will listen for user clicks on any page (you can also target specific pages if you wish):

  • Tag Name: Click Listener
  • Tag Type: Click Listener
  • Firing Rules: Fire on all pages
Getting Started with Google Tag Manager

3. Tracking Clicks on a Specific Element

Now that we have the basic tags setup to track page views and listen for clicks, we can create a tag that will be used to track clicks on a specific element your site. Once that is done, you’ll be able to view the data in Google Analytics’ “Behaviour” section under the “Events” submenu.

Create a new tag. This tag will be used to track clicks on a call-to-action button so we can gather data related to that specific button. For the purposes of this guide, we’ll assume the ID assigned to the button is “header-button”.

Here are the basic settings we’ll use to setup the tag:

  • Tag Name: Header Button Click
  • Tag Type: Universal Analytics
  • Tracking ID: Your Google Analytics tracking code for the property.
  • Tag Type: Universal Analytics
  • Track Type: Event
  • Event Tracking Parameters: Use the macros to your liking, they’re optional but are great for getting additional insight.

Set the firing rule conditions to fire when “{{event}} equals gtm.click” and “{{element id}} contains header-button”:

Getting Started with Google Tag Manager

This will record a Google Analytics event each time the element with the ID “header-button” is clicked and will be visible from your Google Analytics dashboard.

Great, you’re almost done integrating GTM with your website, but first it is a good idea to test the container to ensure that everything is working as expected. Luckily, Google Tag Manager has some built in features that make testing and debugging quite simple.

4. Testing and Debugging

The final step in integrating GTM with your website is to test the new tags you’ve created and make sure they’re firing where they’re supposed to.

From the container overview page, click on the “Preview” button and select the preview method you’d like to use. If you select “debug” you can navigate to your site and you’ll be able to see what tags are firing in the GTM inspector window at the bottom of your screen. You should automatically see the page view tag fire along with the click listener since the firing rules for those tags were set to fire on every page. If you click on the element with the ID of “header-button” (or whatever ID you assigned in the third step), the tag will and the event will be recorded and reflected in your Google Analytics dashboard.

Getting Started with Google Tag Manager

You can monitor this by having the dashboard open to the “Events” section of the “Real-Time” menu option.

Once you’ve confirmed that everything is running correctly, you can go ahead and publish the container to have the changes take effect. You can view the data in your Google Analytics dashboard under the “Events” section of the “Behavior” menu option.

Great job, you’re all set. I encourage you to explore that many more ways you can use GTM to your benefit because we’re just barely scratching the surface. If you have any questions or comments, let us know in the comments below.

Author: Dylan Dunlop