Get PPC & CRO Knowledge Right To Your Inbox
Covering topics to help your business make more money.

Google Tag Manager:
19-Hack Quick Start Guide

Get Your Free Proposal


251 Businesses Got a Proposal From us Last Month (Dec, 2018). You should Get One Too.

Continue
Competitor Info
Optimization Tips
Custom Pricing
Last Step
Previous step

Don't worry! We need your website and contact info because we want to send you our research for your free proposal.

Send my free proposal
Previous step

Processing...

Thanks!

Please look out for an email from us.

Whoops!
problem here.

try again

Editor’s Note: This post has been updated with new links and content for you. (Yes, you!) 😉
Original Publication Date: July 10, 2017

Google Tag Manager (GTM) is basically a container that houses all the tracking scripts, or tags, for your website. It’s used for PPC conversion tracking, retargeting, analytics, and much more.

Because they’re all in one container, GTM makes it easy to keep track and manage your tags in one place. More importantly, GTM is the buffer that keeps marketers and your IT or development departments happy. (More on that later.)
 

Marketers and Dev team Google Tag Manager

Marketers and Dev team feeling the love – image source

 
Google launched GTM in 2012 to help marketers understand audience behaviors and gain insights into website performance.

GTM has many great features to help you manage your tagging needs. And while these tools have been available for a while, many marketers still think they need someone with coding experience to add “tags” to a website.

With that in mind, here are four reasons why you should care about Google Tag Manager.
 

1) Google Tag Manager Is Free

That’s right! There are no monthly or yearly fees to use GTM.

Before GTM, if your marketing team didn’t know how to add Javascript to a site, you would have asked your IT department for their help with the install.

Most of the developers that I know are pretty expensive and charge hourly, so adding that bit of code to the site can end up costing a lot for that developers’ time.

 

2) GTM Gives You Back Control

When you start, it may not seem like carrying out tag management tasks yourself is beneficial. After all, it puts more work on your plate.

That being said, there are two main benefits of manually managing your tags, especially early on:

  1. Better organization
  2. Quicker implementation or adjustment

Really, these two benefits go hand in hand. If you’re more organized, you may also be more efficient or “speedy” as a result.
 

Benefit #1: GTM As Organizational Hub.

If you use multiple marketing automation services or manage multiple sites with multiple tags, GTM provides an easy-to-use interface for adding, removing, enabling, and disabling tags.

It also allows you to control when and where a tag fires, and what happens after it does get fired. Also, staying organized helps prevent data loss.
 

Benefit #2: GTM Is Super Quick.

One of the biggest hurdles marketers face is getting the development team to have the same sense of urgency as they do.

Tag implementation and adjustments may seem mundane or not “challenging” enough for a developer, which means the task may take a backseat to other priorities.

On the other hand, if you have a highly complex and large website, it may be more cumbersome and take more time in general for a developer.

Whether due to disorganization or waiting on a developer, you can avoid unnecessary push back on campaign launch dates as well as clients breathing down your neck, wondering why things are taking so long.

This is a DIY project that most marketers can do. It’s not like those Pinterest baking projects where you want to make that super cute cake for the party and then it flops.
 

3) GTM Supports Faster Loading

Piggybacking off the value of speed, another reason you should care isn’t just about manpower hours — it’s also about the load time of your website. With GTM, the code is streamlined, which means that tags will no longer bog down and slow your pages from loading.

This plays directly into conversions in two ways:
 

#1: Increased User Time on Site.

Javascript may be a marketer’s worst enemy when it comes to page load times. Basically Javascript is the diva, not letting anything else load until it loads, which means that visitors may get tired of the page loading, bounce, and you lose that potential conversion.

Typically, the sections of the page will load in an order waiting for other sections to load, which is called synchronous. But GTM comes to the rescue. Because GTM loads tags as soon as they’re ready and not in a sequence to other tags, tags fire on the page asynchronously and simultaneously, and saves you a whole bunch of time.
 

#2: Improved SEO Performance.

Because of increased user time on site impacting user experience, it’s factored into SEO ranking considerations.

Saving a couple of seconds on load time may not seem like a big deal in the grand scheme of things. I mean, not much can happen in a few seconds, right? Wrong.

Amazon calculated that it can cost as much as $1.6 billion in sales each year with a slowdown of just one second. Google has calculated that they can lose 8 million searches per day with a slowdown of just four-tenths of a second.
 

4) Multiple GTM Users & Permissions

The final reason you should care about Google Tag Manager is that you have the ability to add multiple users with specific permissions, much like Google Analytics. You can control who has the ability to create and edit tags, triggers, and variables.

Access can be granted in each container. The types of user access options are as follows:

  1. No Access: User can’t see the container in the account.
  2. Read: User can see the container, the tags, triggers, and variables in the container, but unable to make any changes in the account.
  3. Edit: User can create workspaces and make edits, but is unable to create versions or publish.
  4. Approve: User can create workspaces, versions, and make edits in the account, but can’t publish.
  5. Publish: User is able to create workspaces, versions, edits, and publish it.

We’ll go over the complete build out of GTM in the upcoming “How to Set it Up” section later, but creating a user is simple:
 

First, make sure you’re under the Admin tab.

First, make sure you’re under the Admin tab.

 

Then, select User Management.

Then, select User Management.

 

Google Tag Manager “New” red button.

Click the “New” red button.

 

Choose User to add someone.

Choose User to add someone.

 

Google Tag Manager access permissions

Select the level of access or permissions you want the user to have.

 
So, why are users and permissions important? There may be some sections in GTM that you just don’t want other people touching, and potentially messing things up.
 

Don’t let too many cooks in the kitchen.

Don’t let too many cooks in the kitchen. – image source

 
In the wrong hands, the ability to add and edit tags, triggers, and variables can lead to lost data, missed conversions, and crashed websites.
 

Four Failsafes in Google Tag Manager

These four failsafe features can help you prevent and recover from any mistakes you might make within Google Tag Manager.

  1. Workspaces
  2. Previews
  3. Versions
  4. Third-Party Tags

 

1) Workspaces

If you have multiple users working in GTM, Workspaces makes it easy to work on something without even touching what other users are working on.

Workspaces are great for companies with multiple departments working on different projects and for companies working with agencies.
 

2) Preview Your Work

As a PPC-er, I think we’ve all made that mistake of publishing an ad only to realize that there’s a misspelling in the ad copy. Yikes!

With GTM’s preview feature, you can see in real-time — on the page where your tag should be firing — if it actually has fired.
 

All you have to do is click the Preview button in the dashboard.

All you have to do is click the Preview button in the dashboard.

 
Once you do that, visit the landing page where that tag should fire from.
 

Google Tag Manager tags fire

You can see that there are certain tags that are fired and ones that aren’t.

 
From there, you can determine what’s working and what’s not before you publish your new tags.
 

3) Versions

A version is created each time you publish a change to the container. This will help a user create a history of the changes in GTM, when those changes were made, and by whom.

Imagine you notice that something has gone horribly wrong and a tag is broken somewhere. You can simply republish one of the previous versions of GTM.

When you visit the Versions section of GTM, you’ll be able to see when the last version was created and published, by who and the Version items such as tags, triggers, and variables.
 

Google tag manager version changes

You’ll also see the version changes that were made there.

 

4) Built-In Third-Party Tags

If you’re new to GTM, their built-in third-party tags will be like a party for you.
 

Google tag manager party doesn’t start

The party don’t start ’til I walk in – image source

 
Third-party tags require very little coding experience and allow less technical users to be more active it GTM, which made deploying tags quickly easier and errors less likely.

The built-in tags include Google properties like Google Ads, Google Analytics, and Google Remarketing. GTM also offers some more popular tags like AdRoll, HotJar, LinkedIn, Bing UET, and many more.
 

How to Set Up Your GTM

There are three main parts to GTM:

  1. Tag: A snippet or small piece of code (usually JavaScript) that’s pasted into pages of your site.
  2. Triggers: Defines when and where tags are executed.
  3. Variables: Used to receive or store information to be used by tags and triggers.

 

A very simplified look into how GTM looks

A very simplified look into how GTM looks

 

Create a GTM Account & Container Snippet

You’re (finally) ready to get started!

To create an account, go to tagmanager.google.com. You’ll be prompted to Add a New Account if there isn’t already one listed under your preferred email address.
 

The account setup screen

The account setup screen

 
Once you name your company, you’ll set up the Container with the website that you want to manage.

Name your container after your website and choose where you want to use the container (Web, iOS, Android, or AMP).
 

google tag manager Add your website two containers.

Add your website here. If you have more than one website, you’ll need two containers.

 
You’ll be asked to accept the GTM’s Terms of Service Agreement, and then you’re set!

You’ve created the account and your container and ready to start adding in the tags, triggers, and variables you’ll need to start tracking.
 

Plan Tags For Your Site

Before you start implementing any tags, take time to review your site. Take a step back and think from your visitor’s point of view.

How will they navigate the site? What buttons will they click on? What tags do you need on which page?

Some tags you’ll want to add to every step of the site (Google Remarketing), and some tags only on specific pages (Conversion Tracking).
 

Install the Google Tag Manager Container Snippet

Yay! Now it’s time to plant that snippet of code onto every page of your website.

You should see a window with two pieces of code, one prompting you to place in the <head> of the page, and the other after the opening <body> tag.
 

What the fancy GTM tag looks like.

What the fancy GTM tag looks like.

 

Components of GTM

Once you have your account created, the next step is to set up the Container, Tags, Triggers, Variables, and Folders.
 

Containers

You’ll need to create a container once your GTM account is established.

If you’re familiar with The Container Store, it’s a similar idea.

The purpose of The Container Store is to provide solutions for people storing tons of “junk” into one space.

This is essentially what a GTM Container is. It’s a place where you store all your tags, triggers, variables and folders. It provides the functionality to run and deploy tags, and makes it easy to manage them all in one place.

You’ll only need one container if you only have one website. When you’ve placed the code/snippet onto the site, you’ve successfully added GTM!

The three components of Containers are tags, triggers, and variables, aka the bread and butter of GTM. This is basically the heart of the entire system.
 

Tags

Put simply, a tag is a snippet of JavaScript code that is placed on a website to trigger based on a specific user action.

Here are examples of what these tags capture from visitors:

  • Acquisition: How the visitor ended up on the site, what channels they used to get there.
  • Behavior: What pages they’re viewing, how many pages and how much time they’re spending on the site.
  • Conversions: Form submissions, transactions.

Triggers and variables define each tags’ functions. Think of Kronk’s spinach puffs. The puff needs the ingredients and the baker to be whole. Otherwise, it’s just a nice yummy thought. We’ll get more into triggers and variables in a bit.
 

The ingredients that go into creating a tag

The ingredients that go into creating a tag – image source

 
Basically, tags can record any behavior or event on a site and send that data to Google and third-party tags. Without Google Tag Manager, the code needs to be placed directly on the site using source files that a developer will need to set up.

Also, don’t forget that tags can have more than one trigger. For example, you might have a tag that fires each time a page loads and when a click happens on that page.
 

The First Tag You’ll Implement:

Most likely, the first tag that you’ll created with GTM is Google Analytics (GA).

You can add one of two GA tag types. One is the Universal Analytics and the other is Classic Google Analytics.

You can choose between the two, but if you’re already using Classic GA, now may be an opportune time to upgrade to Universal!

To create the new tag, go to the dashboard and click on Add A New Tag.
 

Click on the New Tag box or the Tags icon in the left column.

Click on the New Tag box or the Tags icon in the left column.

 
Name your tag something like “Google Analytics – Page Views” in the upper left corner so that you know that it’s tracking page views.

In the Track Type, choose Page Views, which will track every time a visitor loads a page on your site. There are other options like Event, Transaction, Social, etc. But for now, pageviews will be where you can start.
 

Pageviews is a good place to start.

Pageviews is a good place to start.

 
Configure the tag by adding in your GA ID.
 

The Tracking ID you’ll get from your Google Analytics account.

The Tracking ID you’ll get from your Google Analytics account.

 

GA HTML Tag Implementation:

Adding Google Analytics to GTM with a generic HTML tag is a more involved and complicated process than standard tag implementation. You might need some developer or IT assistance for this task, but it could be the most effective solution for your complex needs.

HTML tags allow you to customize your code and, hopefully, ensure a smooth user experience. And once they’re installed, any tweaks should be manageable by the marketing team after the fact.
 

Triggers

Triggers define which tag is fired and when, and a tag only fires if it has a trigger (formerly known as a “rule”).

You can add all the tags that you want to the site, but without someone pulling the trigger, nothing will happen.

After you create the Google Analytics tag mentioned above, you can move on to creating the trigger.

If you’re doing this for the first time, choose “All Pages.” This means that every time a page is loaded, the tag will fire, which is necessary for Google Analytics.
 

The trigger you choose will determine where your tag fires.

The trigger you choose will determine where your tag fires.

 
In this example, we’ve created a tag for AdRoll, so now we need to tell GTM when to fire that tag.
 

Creating & Choosing Google Tag Manager Triggers

Click on the Triggering box to open up the Trigger options:
 

Figure out when you want your tag to fire.

Figure out when you want your tag to fire.

 
Sometimes users have already created triggers for other tags. You can choose from existing tags or create a new trigger depending on the desired action. To create a new trigger, click on the plus button.
 

You might have some triggers already created, but can add more with the plus button.

You might have some triggers already created, but can add more with the plus button.

 
Name your trigger and click on the Trigger Configuration box. From here, choose your trigger (e.g. page view, click, form submission, custom event, etc.).
 

Choose your trigger type from the selection on the right.

Choose your trigger type from the selection on the right.

 
For example, you can create a trigger for “All Page Views.” The tag will fire anytime someone opens a page on your website.
 

Specifying Triggers For Website Pages

Say you want to create a trigger for a visit to your thank you page. Start by clicking on Page View under Trigger Type.
 

Choose the Page View trigger type.

Choose the Page View trigger type.

 
Rename the trigger “Thank You Page” or another term to identify it easily. You might use it for different campaigns, or you might have different thank-you pages.

Choose Some Page Views, so that it doesn’t trigger on all pages. That’s a sure way to inflate your conversions without meaning to.
 

If you don’t want your tag to fire on all pages, you’ll define the pages here.

If you don’t want your tag to fire on all pages, you’ll define the pages here.

 
Below that, you’ll choose the conditions when the event occurs. The first dropdown has a number of variables to choose from.
 

We chose Page URL.

We chose Page URL.

 

The second dropdown defines the occurrence.

The second dropdown defines the occurrence.

 
The third field is where we define the URL.
 

In this case, the URL will contain /thank-you.

In this case, the URL will contain /thank-you.

 

Variables

Variables are any value assigned, and are used in both tags and triggers.

In tags, a variable captures the dynamic values such as a transaction amount when an item is purchased. In triggers, a variable defines a filter when that trigger is fired. So when someone reaches the /thank-you page, for example, the URL variable is /thank-you.

Google Tag Manager provides some commonly used Built-In Variables. They’re segmented into Pages, Utilities, Errors, Clicks, Forms, and History.

You can also create a User-Defined Variable, which is simply a custom variable that you can create. In some of the examples later in the blog, we’ll use user-defined variables.
 

Folders

Need a break from us defining tags, trigger and variables? Insert Folders, probably the simplest of all these sections of containers to understand. It’s exactly what you think it is, a folder.

If you’ve used Google Drive, you’re probably familiar with this concept. In Google Drive folders, you can keep track of the spreadsheets, docs, and presentations that you’ve put together.

GTM folders can easily organize your tags, triggers, and variables. It makes it easier when you have multiple people working in GTM and organizing the folders by team members, projects, or type of tags.

To create a folder, click on the Folder tab in the left hand column.
 

Then, click the blue button to create a New Folder.

Then, click the blue button to create a New Folder.

 

Add in a name for the new Folder.

Add in a name for the new Folder.

 
When you’ve defined which items you want to move into the folder, check them in the Unfiled Items:
 

Choose which items you want to go into the Folder.

Choose which items you want to go into the Folder.

 
Click on the Move button at the top of the Folder page and choose the folder that you want to put those items into.
 

Then, you’re all set.

Then, you’re all set.

 

Preview & Test Your Work

Once you’ve created your tags, triggers, variables and grouped them into the folders you want, it’s time to launch! (Almost.)

We talked about previewing your work back in the Why You Should Care section above. Before you launch, go through the testing process and ensure everything is working correctly.

Is something messed up? As you’re testing, you may realize that something happened and you need to remove a tag. No worries.

Take a look at your Workspace changes in the Workspace dashboard. Click on the three dots to bring up the options to Abandon Change or View Change.
 

Click Abandon Change and it’s removed.

Click Abandon Change and it’s removed.

 

Launch Your Tags

Yay! You’ve come to the best part of the whole creation process. All the work that you did to create the tags is coming to fruition.
 

To launch, click on the blue button in the right hand corner that says Submit.

To launch, click on the blue button in the right hand corner that says Submit.

 
On the next screen, you’ll see the option to create a new version for these changes. Add a version name and any description so you can easily identify the version, if you need to find it later.

Below that, you’ll see the Workspace changes that you made, the type, when it was edited and by which member of the GTM team.

Verify that everything looks good.
 

Click on the blue publish button, and you’re live.

Click on the blue publish button, and you’re live.

 
Congrats, and happy tracking.
 

Google Tag Manager Hacks & Best Practices

Okay, so you’ve created a GTM account and created some new tags. But now we’ve come to the fun part with some GTM hacks and best practices to make it even better for you.
 

Container Creation

A best practice is to set up an account per company and one container per website.

Many companies will not need more than one container. Remember, the key is to consolidate.
 

Event Tracking

Event tracking is an area where GTM can really shine.

Before GTM, if you wanted to track events such as button clicks and video plays, you would have a developer add the tracking code for each. GTM’s value is really seen when you have a bulk amount of codes to add.

Event tracking is super awesome! Has a client ever asked you how many times a visitor has clicked on a link, video, or multiple buttons, and you just weren’t sure? If yes, event tracking is going to be your new BFF.
 

Built-In Variables Google Tag Manager

Set your Built-In Variables. These are the ones we like to have as a default.

 
Before you start implementing, you’ll want to be sure to configure the Built-In Variables: Pages, Clicks, and Forms. This makes it easy when you start creating more tags and triggers down the line.
 

Scrolling, Scrolling, Scrolling

Do you ever wonder if all that content you created is actually getting eyeballs on it — especially below the fold?

You can use tools like HotJar, which provides heat maps. But this is about GTM, and it has a solution.
 

Bear with me, it’s a bit technical, and we’ll get through this together.

Bear with me, it’s a bit technical, and we’ll get through this together. – image source

 
Rob Flaherty from Parsnip.io created a plugin that uses jQuery to measure how far a visitor is scrolling down a page.

To get started on this, create a trigger and name it something like DOM Ready, which just means that the scroll depth tag will fire when the DOM is ready.

DOM stands for Document Object Model. For our purposes, however, think of it as a whole HTML page. And every time an HTML page (or DOM) finishes loading, the browser will fire a trigger called DOM Ready.

Using Javascript, we can hook into this DOM Ready trigger, so that our code also runs every time a browser loads a new page. Because you want this to fire on all pages when loaded, you’ll choose Pageviews as your event, and to fire on All Pageviews.
 

Create a DOM Ready trigger.

Create a DOM Ready trigger.

 
Once this trigger is created, move on to creating your tag.
 

Choose Custom HTML in the Custom section of the tag types.

Choose Custom HTML in the Custom section of the tag types.

 

Add the code you see in the scrolldepth.js file to the HTML notepad in GTM.

Add the code you see in the scrolldepth.js file to the HTML notepad in GTM.

 
Next, we’ll set up the Variables that we need to make sure this is fired correctly.
 

Setting Up Variables

Variables are split into four different types: Category, Action, Label, and Value.

For each of the variables, you’ll create a Data Layer Variable in the Page Variable Types.
 

Here’s the starting page for creating the next four variables.

Here’s the starting page for creating the next four variables.

 
The four variables will look like the screenshots below:
 

Create your eventCategory variable.

eventCategory variable

 

Create your eventAction variable.

eventAction variable

 

Create your eventLabel variable.

eventLabel variable

 

Create your eventValue variable.

eventValue variable

 

Applying Variables

Once your variables are created, you’ll want to send that tracking information to the data layer. Then you’ll create another Google Analytics Tag specific to scroll depth.
 

Name your tag and choose Event as the Track Type.

Name your tag and choose Event as the Track Type.

 

Add in the variables that you just created to the forms below.
 

The four variables that you created are added into the tracking parameters.

The four variables that you created are added into the tracking parameters.

 
if you have the field titled “Non-Interaction Hit” set to “True,” these events will not affect the site’s bounce rate.
 

Creating a Custom Trigger Based on Your Variable Event

Finally, you’ll want to create a trigger to fire when the “event equals ScrollDepth”. The trigger type that you’ll choose is the Custom Event.
 

The trigger in this situation is a Custom Event.

The trigger in this situation is a Custom Event.

 
Name your trigger, add the event name, and save everything. Test your version to make sure everything looks good, and then publish your work.
 

Scroll Depth Google Tag Manager

Scroll Depth should be on all pages, unless there’s a reason to exclude any pages.

 

Track On-Site File Downloads

While conversions are important, don’t underestimate the power of micro-conversions. These can come in handy before the conversion or even after the conversion.

For example, we have a client who, after their visitors downloaded the white paper, were given the option to download other PDFs. We wanted to track this to see what visitors’ interests are, so we can offer something different at another time.
 

Visitors to the thank you page have the option to download additional PDFs.

Visitors to the thank you page have the option to download additional PDFs.

 
To do this, start by creating a new Trigger.

  • Choose the Trigger type.
  • Click “All Elements”.
  • From “This trigger fires on,” choose Some Clicks.
  • Change the first dropdown to Click URL.
  • Change the second dropdown to matches RegEx (ignore case). It’ll match a regular expression of text string, ignoring the case.
  • In the form field, add in the fire on condition. If you want to track a PDF, PPT, PNG, you’ll want to use \.(pdf|ppt|png)$

There may be other types of documents that you want to track, and you can make that change in the form field.
 

In this case, we want to track PDF, PPT & PNG.

In this case, we want to track PDF, PPT & PNG.

 
Once your trigger is created, you’ll just need to add it to the tag that will send the data to GA where you can see the downloads. In addition, you can set up a goal, so that you can track this simply in GA.
 

Track File Downloads Offsite

Cool. So, we can track visitors downloading on our pages, but what if we send that traffic to a link in a social media post or an email?

We’re unable to add GTM with those other channels, but we can hack our way through it.

We need to create a bridge between our site, where our link is coming from, to the place where the visitor ends up.
 

The bridge between our website, and where the visitor ends up

The bridge between our website, and where the visitor ends up – image source

 
Set up two tags — a GA tag and a custom HTML tag, which we explained in the Scroll Depth section above.
 

Cross-Domain Tracking

Tracking traffic across different domains and subdomains can be a pain.
 

Cross-domain tracking makes me scream out loud.

Cross-domain tracking makes me scream out loud. – image source

 
If, for example, you have a client who has a domain on one website, but checkout on another, this section will be helpful for you.

To get started, you’ll want to create a few user-defined variables.  

Creating User-Defined Variables

Go to the Variables section in Google Tag Manager, and click to create a new User-Defined Variable.
 

You’ll choose the Constant Variable Type under Utilities.

You’ll choose the Constant Variable Type under Utilities.

 
The first variable that we’ll create is the gaProperty one, which is simply the fastest way to add the GA Tracking ID to all new tags that you’ll create.

In the value field, enter in your GA ID, which will look like UA-XXXXXXXX-X (the X’s are your numbers).
 

The value here is the Google Analytics ID.

The value here is the Google Analytics ID.

 
The second variable that you’ll set up is the gaDomain. This variable is to make sure that the website domain is always set to auto.
 

Setup your gaDomain variable.

Setup your gaDomain variable.

 
The third variable that you’ll set up is the gaCrossDomains. You’ll set this up if you have traffic going from one domain to another.
 

In the field, you’ll add your list of domains, separated by a comma with no spaces.

In the field, you’ll add your list of domains, separated by a comma with no spaces.

 
With these variables in place, cross-domain tracking will be much easier. Go into your Universal Analytics tag:
 

Under More Settings, click on Fields to set and add in 2 new fields.

Under More Settings, click on Fields to set and add in 2 new fields.

 
The field name will autofill as you type in. For allowLinker, type in true for the Value. Do the same for cookieDomain. Because you created the gaDomain variable, you can choose that easily here.

Next, under More Settings, click on the Cross Domain Tracking dropdown.

Because we added all the domains that we want to track in the gaCrossDomains variable earlier, just choose Auto Link Domains here. Choose False and False for the Use Hash as Delimiter and Decorate Forms fields.
 

All the work you did earlier makes it simple for you to choose the Auto Link Domain.

All the work you did earlier makes it simple for you to choose the Auto Link Domain.

 
As soon as you test, debug, and publish, you’ll be tracking cross-domain traffic.
 

Track Time On-Site With Timer Triggers

While Google Analytics measures time on site, doing it through Google Tag Manager can measure the visitors with a bit more accuracy.

For example, let’s say a visitor spends one minute on one page of your site. Then she goes to the Pricing Page, reads some information, and then closes the tab.

In Google Analytics, the time on the Pricing Page isn’t counted. GA tracks the time-on-site between two hits, not the amount of time spent on two pages.

That’s where Trigger Timers come to the rescue.
 

Create a new trigger and choose Timer under the Other category in Trigger Types.

Create a new trigger and choose Timer under the Other category in Trigger Types.

 
Set an interval in the field, and keep in mind that 30 seconds equals 30,000 milliseconds. Limit the trigger to fire only once.
 

Have it trigger on all pages and for all timers.

Have it trigger on all pages and for all timers.

 
Now that that Timer Trigger is created, you’ll want to create a tag to push this event to GA.
 

Creating Tags For Pushing Events To Google Analytics

Start by creating a new Event Track Type tag for your Timer Trigger GA.

Add in the variables into Category, Action, and Label to define the tag. Finally, you’ll choose the trigger that we just created, save, test and publish.
 

Choose the trigger that’s going to fire your timer tag.

Choose the trigger that’s going to fire your timer tag.

 

Tag Sequencing

Not all tags are created equal, and you may want certain tags to fire before others.

If you have a specific order for which you want your tags to fire, Tag Sequencing will allow you to specify if you want the tag to fire before or after another tag.

If you’re looking to establish dependencies, Tag Sequencing can be really helpful. It’s a complex feature offered by Google Tag Manager that can get a bit more technical. Read this Google post to learn more.
 

Exclude Internal Traffic

It’s important to exclude internal traffic from your Google Analytics tracking. This traffic can mess with your visitor data by skewing time on site and page views.

Further, internal traffic isn’t going to convert, which can bring down your overall conversion rate.
 

You don’t want your conversions % looking like Yzma.

You don’t want your conversions % looking like Yzma. – image source

 
To exclude internal traffic, create a variable and name it IP Address. Choose Data Layer Variable as the Variable type.
 

To start excluding IP addresses, you’ll use Data Layer Variable.

To start excluding IP addresses, you’ll use Data Layer Variable.

 
Name the Data Layer Variable and save.
 

Name your variable.

Name your variable.

 
Next, you’ll create the trigger to fire this.

You’ll choose Custom Event as the Trigger type, add a name for the event, and choose for the trigger to fire on some custom events. In the fields below, you’ll choose IP Address and add in the IP address that you want to exclude.
 

Add in the IP address that you want to exclude.

Add in the IP address that you want to exclude.

 
You can then add this event to your Universal GA tag.
 

Tag Assistant For GTM

Once you have your tags added to each page of your site, you might want to check if GTM is actually there when you browse your site.

If you’re using Chrome as your browser, you can add the Tag Assistant, which will help you troubleshoot any tags that you’ve installed.
 

Tag Assistant in the Chrome Store.

Tag Assistant in the Chrome Store.

 
Once you’ve added the Chrome extension, it’ll appear in your browser with the Tag Assistant icon. When you’re on your site and click on the Tag Assistant icon, you’ll see the following screenshot:
 

There’s a conversion tracking tag, GA tag, and GTM added to this page.

There’s a conversion tracking tag, GA tag, and GTM added to this page.

 

History Change

Another trigger type that’s available to use is the History Change, which will fire when the browser history changes. This trigger is useful for tracking virtual pageviews in an AJAX application.

In plain English, this is when you click something on a page and you don’t see the URL change, but a hashtag is added to the end of the URL.

A good example comes directly from the Google Support page about Triggers:
 

The Tag Manager Help page

The Tag Manager Help page

 
When I clicked on History Change, the page reloaded, but the URL didn’t change and the hashtag was added.
 

The URL that shows with the hashtag at the end of the URL.

The URL that shows with the hashtag at the end of the URL.

 
There are five variables to choose from, which you can learn more about from Google’s Trigger Support.
 

Choose the variable from the dropdown to meet your condition.

Choose the variable from the dropdown to meet your condition.

 

Blocking Triggers For Tags

When a trigger is tripped, a tag will fire. There may be circumstances, though, where you don’t want a tag to fire on certain pages. Luckily, there’s a solution for this.

Say, for example, that you have a tag to trigger on “all pages,” and you add a blocking trigger of “URL equals /ebook-download”, the tag will never fire on the Ebook Download page. The blocking trigger will always override the other trigger.
 

In the Tag menu, click on “Add Exception”.

In the Tag menu, click on “Add Exception”.

 

From the Trigger menu, choose the trigger that you want as the exception.

From the Trigger menu, choose the trigger that you want as the exception.

 

After you have the exception added, click Save.

After you have the exception added, click Save.

 

Tag Blacklist & Site Security

The security of your website is super important to your dev team (and if it’s not, it should be). Luckily, Google Tag Manager has a hack to ensure just that.

Tag Blacklist will allow you to define which tags should never be added to the website in order to maintain security of the site.

This is another hack that might be better implemented by your dev team, but it’s important for you to understand the use cases of this feature.

Read this post from Google to learn more about site security measures in Google Tag Manager.
 

Track JavaScript Errors

This is commonly used by development teams, but it’s important as a marketer to understand JavaScript errors and how they can affect you — or when you need to get your dev team involved.

In a worst-case scenario, JavaScript errors can prevent all of your website’s JavaScript from working, which includes dropdowns, tagging, analytics, hovers, etc., and leads to a terrible user experience.
 

How I feel when a website doesn’t work

How I feel when a website doesn’t work – image source

 
To track this, you’ll need to start by creating a trigger called “JavaScript Error,” which is an existing trigger type that you can choose.
 

Choose JavaScript Error from your selection of trigger types.

Choose JavaScript Error from your selection of trigger types.

 
Next, you’ll create a tag. You’ll want to duplicate the GA tag and rename it “Google Analytics Exceptions” so you’ll know that it’s different from your other GA tags.

The Track Type is an Event, and you’ll want to fill in the other fields based on the screenshot below.
 

Add in the fields for Category, Action, and Label.

Add in the fields for Category, Action, and Label.

 
Finally, you’ll want to ensure that your variables are enabled. In the Built-In Variables, go to configure it, and in the Errors category select Error Message, Error URL, and Error Line.
 

Choose the three Error Built-In Variables.

Choose the three Error Built-In Variables.

 

Tracking JavaScript Errors as GA Goals

Most marketers are familiar with creating goals in GA to track positive conversions like purchases and free trial sign-ups. Well, you can also track negative goals, and JavaScript errors fall under that category.

Creating a goal in GA can help you identify when a JavaScript error occurs so you can pinpoint the problem quickly.

For more information on how to create GA goals, read about them here.
 

Wrap Up on Google Tag Manager

Marketers, rejoice! GTM has been the solution that we’ve been waiting for. It helps navigate tracking code on sites, allows us to be more efficient with our time, and prioritizes what we task to our IT and development teams so that they can focus on what really matters.
 

Google Tag Manager coming together

Your team when GTM is fully implemented – image source

 
This post is really meant to help you understand the basics of Google Task Manager and open up your mind to other possibilities.

Take advantage of how fast you can create tags, triggers, and variables as well as play with them without having to publish them.

GTM provides a great opportunity to test and see what works. Then, that totally awesome feeling when you discovered something new.
 

That feeling when you’re on top of the world

That feeling when you’re on top of the world – image source

 
If you have used Google Tag Manager before, I would love to hear about your experience and if you found the previously mentioned benefits to be true. Leave a comment below to keep the conversation going.

Klientboost Blog Author Kim Fitkin

Kim Fitkin

VP of Client Services

Over 445 businesses got a proposal from us in August, 2019

free proposal graphicfree proposal graphicGET MY FREE PROPOSAL
Continue

What's In The Proposal?

Competitor Info
Competitor Info
Optimization Tips
Optimization Tips
Custom Pricing
Custom Pricing
... and so much more!
Last Step
Previous step
"

When it comes to PPC, the first person I turn to is Johnathan Dane. He and his team cut through the bullshit and get straight to the point with the goal of making you more money. Work with him.

"
Peep Laja
Peep Laja
Founder @ ConversionXL
Please enter a valid URL (e.g. www.myhomepage.com)
Send my free proposal
Previous step
phone icon

Prefer to call?


Reach us directly to chat with one of our PPC & CRO experts


Call Now

(866) 204-2028

Processing...

Thanks!

Please look out for an email from us.

Close window

Whoops!
problem here.

try again