April 16, 2015

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.

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

Google Tag Manager - Settings for tracking page views

Fire on all pages:

Google Tag Manager - Fire tag on all pages

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

Google Tag Manager - Click Listener Tag

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

Google Tag Manager - Track button clicks

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.

Google Analytics real-time event tracking

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.

Filed under:  Analytics & Diagnostics Tutorials  ||  Tagged under:

Dylan Dunlop

When he isn’t honing in on his coding skills, Dylan’s either mastering various styles of guitar playing or bird watching.
Leave a comment
comments powered by Disqus

Base Terminology

SEO is the process of affecting the visibility of a website or a web page in a search engine's un-paid ("organic") search results.
The semantic web refers to the next stage of the world wide web and aims to ascribe semantic meaning to all web content through a collection of systems of classification. This means that, in the future, machines will be able to better understand the content we produce, resulting in better search results, new applications and an Internet that is fundamentally different from the one we use today!
What if each of the objects around you had a unique identifier that can be connected to the Internet? The goal of the Internet of things is to equip all objects in the world with tags that allow them to be digitally organized or manipulated. The implications? Less theft, less waste and the ability to control your surroundings in a manner never before possible.
Conversion optimization is the practice of modifying the parameters of a lead-generating system to stimulate a higher success rate as defined by goals. Most conversion optimization is structured to create an increase in ROI (return on investment). We frequently use multivariate and A/B split testing when optimizing conversion, wherein we test two or more systems at the same time, analyze their performance and deduce precisely what action items will bring us closest to the set goals in the least amount of time.
Market diagnostics or analytics is the process of collecting and analyzing business data — especially consumer data. This allows us to assess and improve the effectiveness of a marketing campaign.
In many applications today, there is such a phenomenal quantity of data available that it's difficult to collect and process with traditional database tools. The field of collecting, manipulating and drawing conclusions from massive quantities of data from a particular source is known as big data.
What started as a CMS (content management system) that was only meant to create and edit blog content has grown at a tremendous rate to become the most ubiquitous system for developing websites on the internet. WordPress accounts for an incredible 15% of all sites on the web.

RT @PicardTips: Picard engineering tip: Use the metric system.

4 months ago

RT @PicardTips: Picard management tip: Suppress your inner alarm. Be the calmest person in the room.

1 year ago

RT @dakami: i'm not saying everything you need to know about hacking, machine learning, and hacking machine learning is in this photo https…

1 year ago

Request Our Portfolio

  1. Which option best describes you? *

  2. Are you a key decision maker in the business you represent? *