• Joseph Lowe

Beginner’s Guide to Google Tag Manager:Tracking Page Clicks & Using Timers

Prior to using Google Tag Manager, my thoughts on tracking engagement were limited to what Google Analytics offers out of the box. The high-level metrics that we typically glean are your pageviews, bounce rate, or perhaps a few conversions to track if users are taking actions on your site that might lead to revenue down the line. For other engagement metrics like time on page, specific link clicks or scroll depth, I commonly looked towards engagement tracking software like CrazyEgg or Hotjar.

That’s not to say that either of these platforms won’t get you the engagement tracking you need, but Google Tag Manager offers a free platform that can provide a wealth of information for your marketing team. The problem is that it’s often a road less traveled because it’s perceived as being difficult to set up.

In this blog post, I hope to prove Tag Manager is useful and easy to understand as we dive into how to gather more information on user interaction on your website through using timers and tracking link clicks and element clicks.

Per usual, before we start, I must give Chris Mercer from Measurement Marketing a quick shout out as I gleaned information from his course at CXL Institute, and his course goes into even greater detail on the subject if you’re interested. Let’s get started!

Setting Yourself Up for Success

We will start this under the assumption that you’ve already created a Google Tag Manager account. Once logged in, it’s important to ensure the correct variables will appear once your tag fires. Since, we’re focusing on clicks, the variables above would be good information to pull through when the tag fires. Remember that a variable is simply information that Google Tag Manager can pull through when tags fire to A) provide extra information to the Google Tag Manager user or B) determine if a tag should fire in the first place. Once those variables are configured, we’re ready to set up our first click trigger!

Setting up Click Triggers

The first step here is to create the triggers needed for the tag to fire in the first place. The initial tag we need to set up here is the hyperlink click tag, which is a pretty simple set up. Just click your triggers tab, and choose the just links trigger type. Once selected, you’ll see a few options to choose from – wait for tags, check validation and whether to trigger on some links vs. all links. Since in this case, we’re just trying to trigger all link clicks, we can simply choose all link clicks and continue on with our chosen link naming convention.

The second step here is to create the all element click trigger, which is distinctly different from the hyperlink click trigger. Not all clicks were created equal, and both triggers can measure different clicks. The hyperlink trigger will only measure when a piece of text that is hyperlinked or a URL on a page is clicked, while the all element click trigger will measure any click at all on the site. Let’s look at a few examples.

As we hop into preview mode, we gain some insight into how these triggers are firing. Google Tag Manager’s preview mode allows Tag Manager users to test out their tags, triggers, and variables in real-time before publishing them live. In the preview example on the top, we see that there’s very little information provided by the variables that are set up. The reason for that is because that was simply a click on whitespace in the upper right hand corner of the page, so there would be no information to relay back to Tag Manager. In the preview example on the bottom, we can see that the click text reads as “Blog” and the click URL reads as “”, which means that this was triggered for a hyperlink click on our blog hyperlink in the top menu.

Now firing events for all link clicks and all elements is all fine and dandy, but in reality it’s rare that these expansive triggers will be used as is within a tag. Could you imagine firing a trigger for every single click on your site? Sheeeesh! Luckily, Tag Manager allows users to get much more specific as they set up triggers and tags.

Setting up GA Events Tags

Tracking link clicks is great and all, but what if we want to just track something like request info or request a demo hyperlink clicks on your site? After all, those types of CTAs are typically your money makers right? Let’s take a look.

First, we’re going to set up our first Google Analytics: Universal Analytics tag. Traditionally, most people have their Google Analytics account set up as the universal account type, but for some of you seasoned Google Analytics users that might not be the case. Just my two cents, but it’s always smart to check! Secondly, we’re going to set up our track type, category, label and value. In this case, my naming convention is as follows:

  • Track type = Event

  • Category = Engagement

  • Action = Contact Us

  • Label: Occurred on this page ----> {{Page URL}}

In addition, not pictured here, there is a drop down called Google Analytics settings that allows you to connect your GA account so that these events are tracked in Google Analytics. The track type, category and action seem pretty normal, but the label might seem a little confusing. Let me clarify. Tag Manager allows you to use any variable you’d like as a category, action or label within Google Analytics by clicking the small box and plus sign to the right of the field. The {{Page URL}} label will show what page that this hyperlink click occurred. So if you have multiple pages where your contact us CTA is present (as we do), I can now see what page URL the click occurred on. It’s pretty neat stuff!

Additionally, we had to build another trigger that only fires when the contact us hyperlink is clicked. In order to build this trigger, we simply create another just link trigger as we previously did, but rather than choosing all link clicks, we’re going to choose some link clicks. Once some link clicks are chosen, Tag Manager provides a drop down with numerous conditional values that you can choose from. In this case, we’re going to pick click URL must contain “contact” since that’s what our request form URL currently contains. Once set up, we can easily make it the trigger to our tag as seen on the right image above. Now let’s test to see if it worked.

On the upper left image here, we can see when the contact us request form is clicked, the event tag we built does fire correctly. In the upper right image here, we get a quick look at our Google Analytics account real-time report. I got a bit hyperlink click happy, but we can see that the event category, event action and event label telling us where the click actually happened is pulling through as well. It looks like this event tag set up was successful.

Setting up a Timer Trigger

The last cool Tag Manager tip we’re going to review is tracking time. The goal of this test is to see who immediately reads our blog when coming to our site within the first 20 seconds of visiting the site. We want to know how often people are coming to the site to immediately check out blogs versus reach out to start a business relationship.

The most important part of this particular setup is the actual trigger. This trigger is going to be a little more complicated than a typical trigger that might be just based on time, but bear with me here. We can create a timer tag by first naming it per our chosen naming convention. The interval time is simply the amount of time in milliseconds that we want to measure. Since we’re shooting for 20 seconds here, we can put 20000 milliseconds and limit it to fire only once because we want to make sure we’re only measuring the first 20 seconds of active site time. Lastly, we want this trigger to fire on every page, so we use our regular expression of .* (which stands for all pages), and we must limit the tag triggering to only when someone clicks a blog URL.

Here is our quick event setup in using Google Analytics UA as well. The big difference between this and our last one is we’ve chosen the action and Blog Read and label as the variable click URL, which will allow us to see which blog it is that was clicked on so quickly.

As we test this out in preview mode and via Google Analytics, we can see that this was a successful event setup as well. We simply clicked the blog homepage as an example here, and we see that tag was fired in the left image and the event passed through to Google Analytics in the right image.

In the meantime, what triggers are you using and why? How are you tracking links on your website? We’d love to hear how you’re optimizing your GTM account to better suit your business and clients.

This post was created in an effort to complete my CXL Institute Minidegree Scholarship obligation and speak to the materials reviewed in the course. The information is a combination of my previous knowledge and excellent insights from a phenomenal program.

12 views0 comments