Loading ...
Sorry, an error occurred while loading the content.
 

Tracking Google Analytics Events with Google Tag Manager

Expand Messages
  • ju2ltd
    Is there a way to tag events such as a button click using Google Tag Manager without the need to call _trackEvent as the onclick event. In other words with out
    Message 1 of 8 , Nov 28, 2012
      Is there a way to tag events such as a button click using Google Tag Manager without the need to call _trackEvent as the onclick event. In other words with out the need to involved developers or html code at all.

      May be this is too much too expect!

      Jim.
    • VaBeachKevin
      Actually yes, you can track clicks of links (or buttons or whatever) using Google Tag Manager, without needing to make any changes or additions to the page or
      Message 2 of 8 , Nov 28, 2012
        Actually yes, you can track clicks of links (or buttons or whatever) using Google Tag Manager, without needing to make any changes or additions to the page or the link itself. The way I do it is to add a new tag in GTM with the type of "Custom HTML Tag". In there I use some jQuery to listen for clicks of certain elements on the page, and in that function I add my dataLayer.push calls to trigger events in GA (or any other analytics tool I have being served through GTM). I can add any click tracking to any element, and will never need to make any changes to the html of the page.

        Kevin Rogers
        @vabeachkevin


        --- In webanalytics@yahoogroups.com, "ju2ltd" <jim@...> wrote:
        >
        > Is there a way to tag events such as a button click using Google Tag Manager without the need to call _trackEvent as the onclick event. In other words with out the need to involved developers or html code at all.
        >
        > May be this is too much too expect!
        >
        > Jim.
        >
      • ju2ltd
        Kevin that sounds very interesting what JQuery do you use for that? Jim.
        Message 3 of 8 , Nov 29, 2012
          Kevin that sounds very interesting what JQuery do you use for that?

          Jim.

          --- In webanalytics@yahoogroups.com, "VaBeachKevin" <vabeachkevin@...> wrote:
          >
          > Actually yes, you can track clicks of links (or buttons or whatever) using Google Tag Manager, without needing to make any changes or additions to the page or the link itself. The way I do it is to add a new tag in GTM with the type of "Custom HTML Tag". In there I use some jQuery to listen for clicks of certain elements on the page, and in that function I add my dataLayer.push calls to trigger events in GA (or any other analytics tool I have being served through GTM). I can add any click tracking to any element, and will never need to make any changes to the html of the page.
          >
          > Kevin Rogers
          > @vabeachkevin
          >
          >
          > --- In webanalytics@yahoogroups.com, "ju2ltd" <jim@> wrote:
          > >
          > > Is there a way to tag events such as a button click using Google Tag Manager without the need to call _trackEvent as the onclick event. In other words with out the need to involved developers or html code at all.
          > >
          > > May be this is too much too expect!
          > >
          > > Jim.
          > >
          >
        • Eric Huang
          Hi, SkyGlue can automatically track click events on pages and you just need to add a snippet of JavaScript using GTM. You can
          Message 4 of 8 , Nov 29, 2012
            Hi,

            SkyGlue <http://www.skyglue.com/> can automatically track click events on
            pages and you just need to add a snippet of JavaScript using GTM. You can
            customize the event tracking in the management portal without developers.

            The detail is to set up SkyGlue in GTM is here:
            http://www.skyglue.com/how-to-use-skyglue-in-google-tag-manager/

            Thanks,

            Eric



            On Wed, Nov 28, 2012 at 8:48 AM, ju2ltd <jim@...> wrote:

            > **
            >
            >
            > Is there a way to tag events such as a button click using Google Tag
            > Manager without the need to call _trackEvent as the onclick event. In other
            > words with out the need to involved developers or html code at all.
            >
            > May be this is too much too expect!
            >
            > Jim.
            >
            >
            >



            --
            Eric Huang, Ph.D.
            Co-Founder and CEO, SkyGlue.com <http://skyglue.com/> |
            @skyglue<http://twitter.com/skyglue>
            425-835-3818 | LinkedIn <http://www.linkedin.com/in/ericyhuang> |
            @ericyhuang <http://twitter.com/ericyhuang>
            *Google Analytics + SkyGlue = Simple Event Tracking + Better Customer
            Insight*


            [Non-text portions of this message have been removed]
          • VaBeachKevin
            Depending on the page I will set it up using a simple click event: jQuery( #linkID ).click(function(){ dataLayer.push({ event : MyCoolLinkClick }); }) Or if
            Message 5 of 8 , Nov 29, 2012
              Depending on the page I will set it up using a simple click event:

              jQuery("#linkID").click(function(){
              dataLayer.push({'event':'MyCoolLinkClick'});
              })

              Or if the page has some ajax content or links that may not be available in the dom when the page is initially loaded, I like to use something like delegate (you could use 'on', but a lot of sites may not be using a new enough version of jQuery):

              jQuery(document).delegate("#linkID","click",function(){
              dataLayer.push({'event':'MyCoolLinkClick'});
              })


              Kevin Rogers
              @vabeachkevin


              --- In webanalytics@yahoogroups.com, "ju2ltd" <jim@...> wrote:
              >
              > Kevin that sounds very interesting what JQuery do you use for that?
              >
              > Jim.
              >
              > --- In webanalytics@yahoogroups.com, "VaBeachKevin" <vabeachkevin@> wrote:
              > >
              > > Actually yes, you can track clicks of links (or buttons or whatever) using Google Tag Manager, without needing to make any changes or additions to the page or the link itself. The way I do it is to add a new tag in GTM with the type of "Custom HTML Tag". In there I use some jQuery to listen for clicks of certain elements on the page, and in that function I add my dataLayer.push calls to trigger events in GA (or any other analytics tool I have being served through GTM). I can add any click tracking to any element, and will never need to make any changes to the html of the page.
              > >
              > > Kevin Rogers
              > > @vabeachkevin
              > >
              > >
              > > --- In webanalytics@yahoogroups.com, "ju2ltd" <jim@> wrote:
              > > >
              > > > Is there a way to tag events such as a button click using Google Tag Manager without the need to call _trackEvent as the onclick event. In other words with out the need to involved developers or html code at all.
              > > >
              > > > May be this is too much too expect!
              > > >
              > > > Jim.
              > > >
              > >
              >
            • ju2ltd
              Kevin, Very helpful thanks. Many things to try. Jim.
              Message 6 of 8 , Nov 30, 2012
                Kevin,

                Very helpful thanks. Many things to try.

                Jim.

                --- In webanalytics@yahoogroups.com, "VaBeachKevin" <vabeachkevin@...> wrote:
                >
                > Depending on the page I will set it up using a simple click event:
                >
                > jQuery("#linkID").click(function(){
                > dataLayer.push({'event':'MyCoolLinkClick'});
                > })
                >
                > Or if the page has some ajax content or links that may not be available in the dom when the page is initially loaded, I like to use something like delegate (you could use 'on', but a lot of sites may not be using a new enough version of jQuery):
                >
                > jQuery(document).delegate("#linkID","click",function(){
                > dataLayer.push({'event':'MyCoolLinkClick'});
                > })
                >
                >
                > Kevin Rogers
                > @vabeachkevin
                >
                >
                > --- In webanalytics@yahoogroups.com, "ju2ltd" <jim@> wrote:
                > >
                > > Kevin that sounds very interesting what JQuery do you use for that?
                > >
                > > Jim.
                > >
                > > --- In webanalytics@yahoogroups.com, "VaBeachKevin" <vabeachkevin@> wrote:
                > > >
                > > > Actually yes, you can track clicks of links (or buttons or whatever) using Google Tag Manager, without needing to make any changes or additions to the page or the link itself. The way I do it is to add a new tag in GTM with the type of "Custom HTML Tag". In there I use some jQuery to listen for clicks of certain elements on the page, and in that function I add my dataLayer.push calls to trigger events in GA (or any other analytics tool I have being served through GTM). I can add any click tracking to any element, and will never need to make any changes to the html of the page.
                > > >
                > > > Kevin Rogers
                > > > @vabeachkevin
                > > >
                > > >
                > > > --- In webanalytics@yahoogroups.com, "ju2ltd" <jim@> wrote:
                > > > >
                > > > > Is there a way to tag events such as a button click using Google Tag Manager without the need to call _trackEvent as the onclick event. In other words with out the need to involved developers or html code at all.
                > > > >
                > > > > May be this is too much too expect!
                > > > >
                > > > > Jim.
                > > > >
                > > >
                > >
                >
              • baphil78
                Hi, I m having a similar problem with tracking custom events. We just installed Google Tag Manager two weeks ago and are working the kinks out. There are
                Message 7 of 8 , Apr 1, 2013
                  Hi,

                  I'm having a similar problem with tracking custom events. We just installed Google Tag Manager two weeks ago and are working the kinks out. There are several events we are trying to track; one (supposedly) easy one is a newsletter sign-up. Below is the custom JavaScript tag. We created a tag in GTM set it to fire on pages containing "/newsletter", where the sign-up form is. The tag is set to fire when someone clicks the submit button on that page. Though it's written to capture name and email, all we really care about is knowing if someone clicked on it. GA has constant of 1 when this tag is fired.

                  Unfortunately, we aren't getting any data in GA (I've signed up using different emails on different browsers). When I open the debug window in Chrome, it looks like the below tag is firing. Any clues? Would more information help understand this problem. Thanks Kevin, or to anyone who can offer insight.


                  <script>

                  jQuery(function () {
                  jQuery("#form > div:nth-of-type(2) > input").click(function () {
                  var name = jQuery("#fname").text();
                  var email = jQuery("#email").text();
                  dataLayer.push(['_trackEvent', 'Newsletter Sign-Up', 'Name', name]);
                  dataLayer.push(['_trackEvent', 'Newsletter Sign-Up', 'Email', email]);
                  });
                  });
                  </script>

                  Brian

                  --- In webanalytics@yahoogroups.com, "VaBeachKevin" <vabeachkevin@...> wrote:
                  >
                  > Actually yes, you can track clicks of links (or buttons or whatever) using Google Tag Manager, without needing to make any changes or additions to the page or the link itself. The way I do it is to add a new tag in GTM with the type of "Custom HTML Tag". In there I use some jQuery to listen for clicks of certain elements on the page, and in that function I add my dataLayer.push calls to trigger events in GA (or any other analytics tool I have being served through GTM). I can add any click tracking to any element, and will never need to make any changes to the html of the page.
                  >
                  > Kevin Rogers
                  > @vabeachkevin
                  >
                  >
                  > --- In webanalytics@yahoogroups.com, "ju2ltd" <jim@> wrote:
                  > >
                  > > Is there a way to tag events such as a button click using Google Tag Manager without the need to call _trackEvent as the onclick event. In other words with out the need to involved developers or html code at all.
                  > >
                  > > May be this is too much too expect!
                  > >
                  > > Jim.
                  > >
                  >
                • VaBeachKevin
                  What it looks like you are trying to do is push a Google Analytics event to the Google Tag Manager data layer, and it doesn t seem to know what to do with it.
                  Message 8 of 8 , Apr 1, 2013
                    What it looks like you are trying to do is push a Google Analytics event to the Google Tag Manager data layer, and it doesn't seem to know what to do with it. When you push items into the data layer they need to be name value pairs, not a list of values.

                    This scenario may help. I have a site that has Google Analytics implemented using Google Tag Manager. On that site I have some links for Twitter and Facebook. I want to track them using Google Analytics and Google Tag Manager but I don't want to edit the site at all. I want to do it all from within Google Tag Manager. Here's what I did.

                    In Google Tag Manager the site I'm working on has one Google Analytics tag with the track type of "page view", and its set to fire on all pages. This is the main tag that counts the traffic. I leave this as is. All of the link tracking will happen from other tags.

                    First in GTM I create a Rule called "Social Click Tracking". In that Rule I have it set to use the default macro {{event}}, and I have it equal "socialClick".

                    Next since I will want to know the name of the Social Media site being clicked, I create another macro called "Social Media Click Site". This one has the type of Data Layer Variable, and I use the data layer variable name of "socialSite".

                    Now I create a second Google Analytics tag, this one with the track type set to "Events". For this tag I have the firing rule set to that rule I created, "Social Click Tracking". I also set some Event Tracking Parameters. Category I set to "Social Media", Action I set to "Social Link Click", and Value I set to the previously created macro Social Media Click Site (those are just a few examples, what you set depends on your specific needs).

                    At this point it is ready to start tracking links. All I would need to do is add an onClick to each link I want to track and I'll be all set. But since I did not want to touch the page code in any way, I will create another tag to handle that part for me. This time I create a tag with the type of "Custom HTML Tag". This is where I add a little bit of jQuery that will listen for clicks on links that have the class attribute of "social" (which the links I'm interested in do), and then push the events to the GTM data layer:

                    <script>
                    $(".social").click(function(){
                    var a=$(this).html();
                    dataLayer.push({'event':'socialClick','socialSite':a});
                    })
                    </script>

                    I see all the link clicks firing with the correct data.

                    Let me know if you are still having problems getting it working, I'm happy to help.

                    Kevin Rogers
                    @VaBeachKevin
                    http://keystonesolutions.com
                    http://webanalyticsland.com



                    --- In webanalytics@yahoogroups.com, "baphil78" <baphil@...> wrote:
                    >
                    > Hi,
                    >
                    > I'm having a similar problem with tracking custom events. We just installed Google Tag Manager two weeks ago and are working the kinks out. There are several events we are trying to track; one (supposedly) easy one is a newsletter sign-up. Below is the custom JavaScript tag. We created a tag in GTM set it to fire on pages containing "/newsletter", where the sign-up form is. The tag is set to fire when someone clicks the submit button on that page. Though it's written to capture name and email, all we really care about is knowing if someone clicked on it. GA has constant of 1 when this tag is fired.
                    >
                    > Unfortunately, we aren't getting any data in GA (I've signed up using different emails on different browsers). When I open the debug window in Chrome, it looks like the below tag is firing. Any clues? Would more information help understand this problem. Thanks Kevin, or to anyone who can offer insight.
                    >
                    >
                    > <script>
                    >
                    > jQuery(function () {
                    > jQuery("#form > div:nth-of-type(2) > input").click(function () {
                    > var name = jQuery("#fname").text();
                    > var email = jQuery("#email").text();
                    > dataLayer.push(['_trackEvent', 'Newsletter Sign-Up', 'Name', name]);
                    > dataLayer.push(['_trackEvent', 'Newsletter Sign-Up', 'Email', email]);
                    > });
                    > });
                    > </script>
                    >
                    > Brian
                    >
                    > --- In webanalytics@yahoogroups.com, "VaBeachKevin" <vabeachkevin@> wrote:
                    > >
                    > > Actually yes, you can track clicks of links (or buttons or whatever) using Google Tag Manager, without needing to make any changes or additions to the page or the link itself. The way I do it is to add a new tag in GTM with the type of "Custom HTML Tag". In there I use some jQuery to listen for clicks of certain elements on the page, and in that function I add my dataLayer.push calls to trigger events in GA (or any other analytics tool I have being served through GTM). I can add any click tracking to any element, and will never need to make any changes to the html of the page.
                    > >
                    > > Kevin Rogers
                    > > @vabeachkevin
                    > >
                    > >
                    > > --- In webanalytics@yahoogroups.com, "ju2ltd" <jim@> wrote:
                    > > >
                    > > > Is there a way to tag events such as a button click using Google Tag Manager without the need to call _trackEvent as the onclick event. In other words with out the need to involved developers or html code at all.
                    > > >
                    > > > May be this is too much too expect!
                    > > >
                    > > > Jim.
                    > > >
                    > >
                    >
                  Your message has been successfully submitted and would be delivered to recipients shortly.