Google Tag Manager: Tracking Important Activity on Your Website

Google Tag Manager: An Essential Tool for Website Activity Tracking

Google Tag Manager- An Essential Tool for Website Activity TrackingAre you installing scripts for analytics, pixels, conversion tracking etc on your website?  Or are you using Google Tag Manager?

If the answer is NO, it should be YES!

Google Tag Manager (GTM) is an awesome and essential tool.

In this article, we outline what Google Tag Manager is, how to set it up and how to take advantage of it.

Warning: it’s a little complex to set up but can be extremely valuable.  If you don’t have the technical skill, you may have to call in the geeks!!

What is Google Tag Manager?

You’ll often need to collect information or track activity on your website.  For example, you might want to use Google Analytics to track details of visitors to your website or track visitors so you can target them with Facebook ads.

The normal procedure for this is to get a piece of tracking code and copy it to every page of your website that you want to track.

This starts to get messy as you add more and more code to your website and there are also some potential issues (e.g. it takes time for your website to load these tracking codes).

Google Tag Manager simplifies this (plus there’s lots more functionality too!).

With GTM, you just need to add the code onto your website and then on you go, to Google Tag Manager itself, to add any further tracking code/scripts.

What are the advantages of GTM?

  • Faster – When you open up a web page, everything loads at once.  With GTM, scripts load up asynchronously and it’s faster.
  • Less hassle – Do you have to open up source code to add your scripts?  Or worse, you have to email your developer?!  Now, you can go into Tag Manager and do it yourself.
  • More flexibility – GTM is a powerful tool so there’s a lot more flexibility.
  • Testing – When you create your scripts, you can test them out with a debug mode so you will break your website less often.
  • Version control – There’s a new version number every time you publish and you can easily track changes.
  • Script management – You can assign permissions to different team members so some, for example, can view the tags but not add or change them.

How do you install the Tag Manager?

You start off by creating an account. You can just use your company name.

Every account has one or more containers.  This is just a way of grouping similar stuff together.  If you have one website, you’ll just have one container.

container
Specify the name of the container and what it’s for

 

You’ll get a piece of code that you need to add to your website.  Once it has been installed, you won’t need to add any more code to the website again.

What terminology do you need to be familiar with?

  • Container – This is your bucket for holding all configuration related to your website.
  • Tag – You create a tag to add the code you are using to measure traffic, visitor behavior etc.
  • Trigger – This is how you define when an event happens.  For example, you could say that a tag is ‘fired’ when a certain page on your website loads.  When you create a tag you can create the trigger at the same time.
  • Variables – This is where you specify something like ‘page url’ instead of specifying the actual URL.  I’ll show you an example later of the benefits of this.

Example of Setting up a Tag

The first tag you’ll probably set up is for Google Analytics.  When you set up a tag, you’ll see that there are some templates already defined for popular tools (e.g. Google Analytics and AdWords).

Enter the name of the tag and then click on Google Analytics.  If a template is not available, you need to enter the code you got from the vendor (select custom HTML tag or custom HTML image).

Creating a tag
Setting up a tag

 

After this, you’ll a screen similar to the following:

Google tag setup
Setting up the tag

In this, you specify:

a) The type of analytics you are using – standard or universal.

b) Configure tag – This is where you enter your Google Analytics tracking code.  You get this from Google when you set up your Analytics account.

c) Track type – What do you want to track with this code? For this, we want to track page views.

d) Advanced settings – You can get fancy with more settings.  For example, you could specify the priority of this tag if there are other tags on the page.

e) Fire on – You specify when this tag fires.  It could fire every time a page loads, when someone clicks on a button on a page, when someone submits a form etc.

When you have finished with this configuration, you select ‘create tag’.

But…

…at this stage, the tag is not operational.  You need to publish the changes before it’s operational.  See the next section.

When you have created some tags, this is what is looks like:

tag screen
A list of tags/triggers

 

How to Publish and Debug your Tags

Your tag is not operational until you hit the publish button but, before you do that, you should click ‘preview’.  You can then open up your website in debug mode and see if the tags are firing correctly.

tag publishing
Publishing a tag

 

This is what your site will look like with debug mode on:

GTM debug
Debug mode GTM

 

In the above, you see that three scripts have loaded.

  • ConversionFly – This is a conversion tracking tool.
  • Facebook Pixel – This tracks visitors on your website so you could track Facebook ads.
  • Ontraport Tracking Script – This is an automation tool that needs to track activity from subscribers.

Previously, I loaded a new tag and ran debug mode and there were errors in the script.  If I copied this directly to the website, it could have broken the website.  This debug mode is handy!

Administration

In the administration section of GTM there are various useful pieces of functionality, for example:

User management – You can give permission to users to access an account and/or container.  For example, they could have view, edit, publish and delete access for a container within an account (but not for another container)

Import/export container – You may have container configured from another account that you want to import to save you setting up all the tags again.

Note:  The administration section is where you get access to your GTM code.

Useful Resources

Summary

Google Tag Manager is a powerful and useful tool and, if you have a website, you need to use it!

Once you have it set up, you’ll be glad you have it.

Have you used GTM?  Tell us what you think of it!

55 Responses to Google Tag Manager: An Essential Tool for Website Activity Tracking

  1. Just what I think was about to begin to try and dig in to search for… (._. ) Now to figure out who to choose first…
    Thank you sooo much!

  2. Hey Ian, thanks for posting this article, I see you’ve shared some great tips on how to use this feature. It can really help a lot with tracking the behavior of the visitors.

  3. Ian, great info. I’m going to give the installation a try myself. I’d love to see you in a short YouTube video walking everyone through how to do it as well.

  4. Hi Ian – after reading all the hassle you had to go through just to define one click I guess you appreciate the ease you had defining the same click using Zoom Analytics’ ClickWizard… plus, ClickWizard works also on elements without an ID, which are very common. Continue bringing interesting articles…

  5. What a fantastic tutorial of Google tag manager. I read on Google itself but here is more clear and helpful. Thanks a lot for your this efforts.

  6. Superb tutorial, after reading this tutorial i can understand the benefit of GTM and also i came to know how easily i can use this. Thank you so much Lan

      • You’re welcome Ian!

        I have a question.. I’ve been trying to implement the method you outline above for tracking link clicks using a firing rule to fire if the element id contains a certain string of text. the element on my page looks something like <a href="/xxx" id="yyy-yyy-yy-2-image-chase_gif".

        I created a rule to fire on gtm.click and another rule to fire when {{element id}} contains yyy. I also set up the click listener correctly, and told the tag to pass the full {{element id}} as the action. The tag still does not seem to fire on click of the link.

        Any help you can provide would be greatly appreciated!

        Thank you,

        Justin

      • You’re welcome Ian!

        I have a question.. I’ve been trying to implement the method you outline above for tracking link clicks using a firing rule to fire if the element id contains a certain string of text. the element on my page looks something like <a href="/xxx" id="yyy-yyy-yy-2-image-chase_gif".

        I created a rule to fire when {{event}} contains gtm.click and another rule to fire when {{element id}} contains yyy. I also set up the click listener correctly, and told the tag to pass the full {{element id}} as the action. The tag still does not seem to fire on click of the link.

        Any help you can provide would be greatly appreciated!

        Thank you,

        Justin

  7. Hi Ian, thanks for the tutorial. 2 points though. In your last PDF example, I believe the screenshot should show Tag Type:Link Click Listener

    Also not sure if it matters but the {{event}} firing rule for the listener I have elsewhere is gtm.linkClick

    Not sure if the capital C matters

  8. Hi Ian.
    Thanks for the great article.
    Any idea when someone would set up a tag of type ‘Google Analytics / Universal Analytics’ as opposed to ‘Event Listener / Link Click Listener’?

  9. Hi Ian, I created a GA event and the two rules exactly as you have shown above. But I’ve been trying for three days and always get this result in preview mode. Do you have Any idea what is happening? Thanks!

  10. Hi Ian Cleary,
    I have tried so many times but it’s not performing well. please tell me can i use both tracking code(google analytic and google tag manager) on same webpage.?

    and also tell me what is the syntax to start it in regex rule textbox.?

  11. Question: I send out a email blast with a direct link to PDF (ex. http://www.site.com/document.pdf)

    This link is not on my website in any of its pages at all and really want to track how many times this gets clicked on/downloaded from that link in the email.

    Can this still be accomplished using Google Tag Manager?

  12. Hi Ian,
    I think in your case the tag will fire on every click. Because If you set up 2 different rules, it will fire if one rule is fulfilled.
    To fire the tag only if both conditions are fulfilled, you need to set up one rule with both conditions in it.
    And with this set up (one rule with condition event = gtm.click and elementID = formSubmit) it doesn’t work for me 🙁 Seems to not find the element ID. Any ideas? Thanks!

  13. How about if I wanted to track my videos clicks on my page and not a youtube video (vimeo). thanks

      • I currently get paid something like 6000-8000 bucks a month with an internet task i found on the internet. If you are eager to work basic online task for few h every day from your sofa at home and get valuable checks for doing it… This is ideal for you… CHILP.IT/8d93f4b

  14. I was never aware of Google Tag Manager until now. Truly remarkable. I am going to share these insights with others, I’m sure they will find it useful as I did.

  15. Hi,

    Thanks for the mention in the article!

    I just wanted to correct something, as it can lead to confusion. “Approval queue” is NOT part of the publishing workflow, and it cannot be used in the way you describe in the article.

    Approval queue is a feature reserved for the DoubleClick Floodlight setup, and is used exclusively as part of the DCF implementation process.

    Unfortunately, GTM currently does not have a proper approval workflow. You can leverage environments and the preview mode to improve quality assurance capabilities in the container.

    Simo

      • Nasty is right. Still not quite easy enough. I’d like to see a one button option for code to put on every GA page. Get people started as easy as GA and perhaps eliminate the two channels for casual users.

        I now start every project with GTM, adding FB and Twitter audience code easier and anything else.

Leave a reply

1K Shares