• Home
  • Google Analytics
    • Customizations
    • For Ecommerce
  • Speaking
  • About
    • About Me
    • Contact Me
    • Disclaimer and Privacy Policy

Analytics Talk

Digital Analytics for Business

You are here: Home / Tag Management / Implementing Google Analytics with Google Tag Manager

Implementing Google Analytics with Google Tag Manager

Posted: October 1, 2012 27 Comments

Tag management, and Google Tag Manager, exist to make web analytics implementations easier. If you’ve got a fairly simple site then you should consider using Google Tag Manager to implement Google Analytics. It greatly simplifies the process.

The Standard Google Analytics Tag Implementation

Let’s Walk through a very basic Google Analytics setup using Google Tag Manager. Here’s a video if you don’t want to read :)

I’ve got a small site that used to sell my old e-book. I want to implement the standard Google Analytics tracking code on this site using GTM.

The first thing I need to do is create a container. The container will hold my Google Analytics tag along with any other tags that I may wish to put on the site.

There’s not too much involved in creating a container. You need to name the container and choose a timezone.

Creating a Container with Google Tag Manager

I should mention that Adding a domain to the container is not necessary. It just triggers various help in the user interface. While not necessary I recommend adding a domain.

Once the container has been created it’s time to add the container JavaScript to the site. Copy the code and place it after the opening tag on your site.

Add the GTM Code to your site

Great, now we’ve got a container and it’s time to populate the container with our Google Analytics tag. The GTM team made it easy to install Google Analytics by creating a form for most of the GA tag options, as shown below:

Adding Google Analytics to a site using GTM

For a simple implementation all you need to enter is the web property ID. This is the UA number. You can find it in your Google Analytics account.

Note: Google Tag Manager currently supports only the basic Google Analytics tag. Future releases of Google Tag Manager will allow you to customize your Google Analytics tag.

Next you need to specify the rules associated with your Google Analytics tag. The rules control which pages the Google Analytics tag will appear on. To learn more about rules see this post about understanding Google Tag Manager.

For this implementation we want to add the Google Analytics tag to appear, or fire, on every single page. We can use a default rule that meet this condition.

Add GA tag to all pages using GTM

Once you click Save GTM will save the tag in the container BUT the tag will not be pushed live to your site. You still need to publish the tag. And you should also Preview the tag before publishing, just to make sure it works right.

If you’re interested in learning more about the tag preview and publishing process check out my post on understanding how to preview and publish with Google Tag Manager.

A lot of you are probably thinking about more complex implementations, like those that require cross domain tracking. Right now a lot of those choices are not supported with the standard Google Tag Manager – Google Analytics integration.

But there is another way to implement Google Analytics with Google Tag Manager.

The Generic HTML Tag Method

If you have a more complex implementation, you can use the Generic HTML Tag for the implementation. This type of GTM tag is basically arbitrary HTML. You can put anything you want in this tag. This includes the Google Analytics tracking code and any customizations that you want to include.

Using GTM to Add A Custom Google Analytics Tag

As you can see, you can put the GA tag in the basic HTML tag, with any customizations that you want.

Is it more work than using the standard GTM GA tag? Maybe a little. But if you want to switch to Google Tag Manager ASAP, and you have a complex implementation, then this is the method for you.

Filed Under: Tag Management Tagged With: google tag manager, google-analytics, setup, tag management

Comments

  1. Søren Larsen Pedersen says

    October 1, 2012 at 6:08 pm

    Hi,

    Are you sure about Google Tag Manager not supporting cross domain tracking? – I think that if you add your different domains within the same container, the cross domain tracking might be automated.

    Best regards,

    Søren Larsen Pedersen
    Web developer at Marketing Lion

    Reply
    • Justin Cutroni says

      October 1, 2012 at 7:18 pm

      @Soren: I’m sure. The Domain setting during the container creation is just for Preview mode. But I know that’s a feature that Google want’s to add. Cross domain tracking is something that needs to be simplified.

      Reply
      • Søren Larsen Pedersen says

        October 2, 2012 at 5:47 pm

        @Justin: I just saw Empirical Path saying: “During the certification process, Empirical Path consultants found some specific capabilities that we know we’ll use for clients: […] Simply insert the Google Tag Manager container code on each page and never have to implement cross-domain tracking again!”

        Source: http://www.empiricalpath.com/empirical-blog/19-web-analytics/196-google-selects-us-to-support-new-tag-manager

        Reply
        • Peter Howley, Empirical Path says

          October 3, 2012 at 3:22 pm

          @Soren: please let me look into whether we were getting ahead of ourselves…

          Reply
        • Peter Howley, Empirical Path says

          October 3, 2012 at 3:33 pm

          Our mistake, sorry about that. We got our wires crossed after looking at all the tag mgmt solutions and knowing the cross-domain pain point! Updating blog shortly…

          Reply
  2. Tomáš Kapler says

    October 1, 2012 at 6:43 pm

    Any idea how to implement GA ecommerce tracking using GTM? IMO it may be possible using macros

    Reply
    • Justin Cutroni says

      October 1, 2012 at 7:40 pm

      @ Tomáš: Yup, I have a couple of ideas. It requires a little bit of JS, but you can do it. First, you need to put your transactional data some place where GTM can access it, like the data layer. Then you need to pull it out of the data layer and put it into the ecommerce tag. For this, try using a custom HTML tag that references the ecommerce parts of the data layer. I don’t think a macro would help here. Macros are for holding data that is in the data layer, then referencing them in Rules.

      I like your thinking :)

      Reply
  3. Sushubh says

    October 1, 2012 at 7:37 pm

    Just wanted to ask something. Google Tag Manager does not seem to support codes that interacts with the content on the website. Services that convert keywords into ad links and so on. Is that right?

    Reply
    • Justin Cutroni says

      October 3, 2012 at 10:43 am

      @Sushubh: If I remember correctly, those service usually rely on some JavaScript. You have to place their JS library on your site and then their JS converts keywords to links. You can certainly host that third party JS using Google Tag Manager. Just use a Custom HTML tag.

      Reply
      • Sushubh says

        October 3, 2012 at 11:13 am

        I saw this because it did not work for me. Even the New Tag page has this message:

        Custom HTML can be used to include any tag that doesn’t need to make visible changes to the page (visible changes include tags with ‘document.write’ functionality built into the snippet, or any A/B testing tag, so please don’t use them).

        Reply
  4. Christopher says

    October 2, 2012 at 6:27 am

    great posts – tag manager is my new favourite !

    I just wonder, does Google Analytics code implemented by Google Tag Manager cooperate with Content Experiments tag?

    or in second option is it possible to implement both Content Experiments code and then Google Analytics code in one custom tag?

    Reply
    • Justin Cutroni says

      October 3, 2012 at 10:41 am

      @Christopher: Great question. As of right now, you can not implement Content Experiments with Google Tag Manager because the Content Experiments tag needs to be at the top of the page. The container tag is placed after the opening < BODY > tag.

      Reply
      • Chris Johnson says

        December 4, 2012 at 8:27 pm

        Justin

        Any ETA on support for experiments and tag manager?

        Reply
        • Justin Cutroni says

          February 19, 2013 at 11:12 pm

          @Chris: Sometime after today :)

          Reply
      • david says

        January 21, 2013 at 11:58 am

        @Justin: great post, specially the generic HTML Tag steps. Just wanted to share that I’m currently running a GACE experiment by having both the GACE script placed in the header and the GATC fired from the GTM container script and it works perfectly fine. So this is indeed a possible workaround as Christopher might have suggested in his first point.

        Reply
  5. Robert says

    October 2, 2012 at 1:30 pm

    Thanks for the informative posts. One thing I haven’t been able to find yet is if there is a usage limit for GMT. Is there something similar to GA Standard’s 10 million monthly pageviews?

    Reply
    • Justin Cutroni says

      October 3, 2012 at 10:37 am

      @Robert: No, there are no limits. Primarily because GTM does not collect any data. It just pushes out tags.

      Reply
  6. Greg Cox says

    October 17, 2012 at 9:11 am

    Excellent primer. Thank you, Justin! Good point about the need for publishing.

    Reply
  7. Alex Fusman says

    December 12, 2012 at 10:19 pm

    Just saw the tag manager mentioned in today’s video from Distilled, so I searched it and landed here. Great description of how exactly to use this new tool. I will use it as a reference when starting out with the tool.

    Reply
  8. Hungarian Property says

    July 11, 2013 at 5:08 am

    It took me a while to figure out how to use dataLayer with onclick events with GTM and GA but once it is in place it’s a breeze to use.

    About Content Experiments tags: I would like to do A/B testing with landing pages. Can I use GTM to deploy the tags required for this?

    Reply
    • Justin Cutroni says

      July 12, 2013 at 4:17 pm

      No, unfortunately GTM does not support testing, or any other tags that use the document.write. But that is a very requested feature. Thanks for the comment.

      Reply

Trackbacks

  1. Getting Started with Google Tag Manager - Analytics Talk says:
    October 1, 2012 at 2:14 pm

    […] All About Google Tag Manager 2. Implementing Google Analytics with Google Tag Manager 3.Preview and Publishing Tags with Google Tag […]

    Reply
  2. Google Tag Manager - New Google Tool says:
    October 1, 2012 at 3:25 pm

    […] Implementing Google Analytics with Google Tag Manager – Justin Cutroni […]

    Reply
  3. Implementing Google Analytics with Google Tag Manager … | SFWEBDESIGN.com says:
    October 2, 2012 at 11:38 pm

    […] View post:  Implementing Google Analytics with Google Tag Manager … […]

    Reply
  4. » A new product from Google: Tag Manager (UPDATED) GoingSocial Houston says:
    October 14, 2012 at 7:12 pm

    […] 2. Implementing Google Analytics with Google Tag Manager […]

    Reply
  5. Tracking Google Analytics Events with Google Tag Manager | Web Development, Search Engine Optimization, Social Media Marketing Guru says:
    April 10, 2013 at 5:04 am

    […] a container with a Google Analytics tag. In you don't know how to start have a look at this post by Justin Cutroni. Tracking Google Analytics Event is a three-step […]

    Reply
  6. Tracking Google Analytics Events with Google Tag Manager | psudhir20 says:
    April 10, 2013 at 5:49 am

    […] a container with a Google Analytics tag. In you don’t know how to start have a look at this post by Justin Cutroni. Tracking Google Analytics Event is a three-step […]

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

My Books

Google Analytics by Justin Cutroni
Learn More on Amazon.com

Performance Marketing co-authored by Justin Cutroni
Learn More on Amazon.com

Recent Posts

  • Understanding the Google Analytics Cohort Report
  • Using Offline and Online data to drive Google Analytics Remarketing
  • Understanding Cross Device Measurement and the User-ID
  • Universal Analytics: Now out of beta!
  • Advanced Content Tracking with Universal Analytics

Categories

  • About Google Analytics (25)
  • Analysis (52)
  • Analytics Strategy (3)
  • Campaign Tracking (14)
  • Ecommerce (8)
  • Event Tracking (10)
  • Remarketing (2)
  • Reporting (10)
  • Resources (7)
  • Tag Management (5)
  • Tips (25)
  • Tracking (52)
  • Uncategorized (64)
  • Universal Analytics (9)
  • Web Analytics (15)

Copyright © 2023 ·News Pro Theme · Genesis Framework by StudioPress · WordPress