How to Track Button Click in Google Tag Manager

As we strive to better understand user behavior on our website, a great way to further develop data insight is by understanding how to track button clicks with Google Tag Manager.

For those unfamiliar, Google Tag Manager is a tag management system that enables you to set triggers based on a user action; Eliminating the need for a developer or having to learn how to code in order to track actions.

Button clicks can also be considered an event or conversion depending on your overall website goals, so it's important to understand which buttons are being clicked, how frequently they're being clicked, and if the clicks are leading your audience closer to the desired action that your organization is hoping for.

Although tag manager enables you to do so much more, this post will specifically discuss how to track button clicks with Google Tag Manager.

Understanding Call to Actions (CTA's)

Before diving further into how to track button clicks with Google Tag Manager, it's important to understand the variety of call to action buttons.

The main CTA buttons that you'll see on a website include but aren't limited to:

  • Sign up

Whether it's an event, newsletter, or subscription that's being signed up for, the sign-up button is a crucial CTA that should have a place on your website.

  • Contact

The contact or reach out button enables your audience to get in touch with your organization directly; Whether that be for more information, to give feedback, or inquire on something that they stumbled upon within your site.

  • Download (whitepaper)

The download CTA is significant because it shows clear and distinct interest in a product or service. This is frequently used for Whitepapers or more informative content.

  • Play

Whether it be a video, podcast, or song on your website, the play button highlights that your audience is interested in the message you're conveying and is willing to sit through your content for an extended duration for more of it.

Having effective CTA's and ensuring they're in the correct location on your website is the first half of the battle, the second half is actually tracking the activity and ensuring that your CTA's are actually being clicked on to further engage your audience.

Let's dive into it.

How to Track Button Clicks with Google Tag Manager

  1. Set up universal analytics

Within Google Tag Manager, ensure that you have a tag created that enables universal analytics.

In addition to the tag, the trigger should be set to pageview.

  1. Click on variables, and ensure that all click elements have been added.

This will allow you to customize which tag is fired when a specific button is clicked. Next, let's create a new tag.

  1. Create a button clicks tag

We'll start by tracking all button clicks, but once it's confirmed that the tags are firing correctly, you'll be able to specify the button clicks that you want to track.

  • Name the tag 'All button Clicks'
  • Click on 'Tag Configuration'
  • Choose 'Google Analytics: Universal Analytics' as the tag type

You'll now have to set the track type to correlate with the event we're creating.

  • Set the Track Type as 'Event'
  • Category should equal 'Click'
  • Action type will be set to 'Contact' since we're tracking a contact form

* Be sure to include your Google Analytics Tracking ID which can be found in the admin panel of your Google Analytics account. This ensures that the two accounts are linked when tracking goals (we'll discuss this further later on in the post).

Keep in mind that your naming mechanism will differ depending on the button clicks that you're tracking, but the naming scheme above is meant to provide a baseline example.

  1. Set the trigger associated with the button clicks tag

To distinguish between the two aspects you're looking at (tag type and trigger type), tag types are what activity is being tracked, and the trigger associated with the tag type tracks the action that is being taken.

  • Name the trigger 'All button clicks'
  • Set the trigger type as 'All elements'
  • Enable the trigger to fire on 'All clicks'
  1. Enter preview mode and test triggers

Now that we've created our tags and triggers, it's time to put Google Tag Manager into preview mode and test that your rules are working correctly.

  • Enter preview mode
  • Navigate to your website
  • Click on the button that you'd like to track

You'll now notice that the preview mode of GTM has translated to the below interface once you navigate to your website.

This shows you when tags are fired, which tags didn't fire, and the variables behind the tags.

You can see here that just by loading the page, the Universal Analytics tag that we created earlier fires immediately.

Now, let's test a button click.

After filling out the form on our website, we see that the button clicks tag fires which means the tag has been set up properly.

However, the tag setup currently will track all button clicks on the website; To better track activity and conversions, let's modify the trigger so that it only tracks specific button clicks.

It's important to test out the trigger with all button clicks first to ensure that it's working properly, but you'll ultimately go back and make the trigger more specific.

  1. Tag each button separately

In step 2, you added all click element variables so that they can be used for customizing each tag specific to a button; Now you can put those variables to work.

Upon looking at the data variables within the click, you'll see below.

Based on these variables, you can take a 'value' that is unique to that button so that it can be used as a filter within Google Tag Manager; Ensuring that the tag only fires when the click contains the specified value. For this example, we'll copy the data in 'Click Classes'.

Go back into GTM and edit the button clicks trigger that was set earlier.

Where the tag was previously set to fire on 'All Clicks', edit to fire on 'Some Clicks', with the new variable (Click Classes) and new value (wpcf7-form-control wpcf7-submit btn btn-coffee btn-medium).

Once these changes are saved, the trigger will only fire when that specific button is clicked and you'll know exactly where your audience is engaging within your site.

To complete this step, be sure to click refresh and then navigate back to your website to ensure that the tag is still firing.

Be sure to repeat these steps for each button on your website that you'd like to track clicks against.

Set Up Goals in Google Analytics

What was just created in Google Tag Manager is what is called an 'Event'. Within Google Analytics, you can create 'Goals' that stem from the events. The goals will give you a dashboard that shows how frequently they're being reached.

You can also set a dollar value against these goals. For example, if for each contact form that's submitted you gain a lead that pays an avg. of $500 for your product or service, then you'd set the goal value as $500. The value will tally up over time and you can compare to your actual generated value to better gauge the accuracy of the value.

To create the Goal:

  1. Click on the admin panel of your Google Analytics account
  1. Within the View Panel, click Goals
  1. After choosing 'New Goal', select the custom tab
  1. Align naming with Google Tag Manager

Within Google Analytics, label the goal using the same naming mechanism that you used in Google Tag Manager. (Step 3 of the GTM Setup portion of this post)

Ensure that your Google Analytics account matches what was inputted into Google Tag Manager below:

You'll then be able to verify that the goal is receiving data by clicking 'verify'.

If for some reason the conversion rate populates 0%, be sure to go back and validate that all fields were filled out correctly.

For more information, check out this article that further explains how to track goals in Google Analytics and why it's an important feature.

Enhancements Over Time

Now that you're creating events and are tracking goals based on those events, you'll be able to better understand how your audience engages with your website. Understanding user behavior is underrated data that any organization can benefit from if properly tracked.

For example, if one button is receiving more clicks or a higher conversion rate than others, seek to understand why that is the case so that your other CTA's can be enhanced for higher rates as well.

By understanding how to track button clicks with Google Tag Manager, you'll be able to place your call-to-action buttons on your website where they'll have the best chance for conversions.

Keep in mind that button clicks are just the start of data that you should be tracking on your website but are a great way to start analyzing what your audience responds the best to.


Let us know how you're tracking button clicks or to learn more about goals and event tracking.

How to Track Button Click in Google Tag Manager

Source: https://rubicomdigital.com/how-to-track-button-clicks-with-google-tag-manager/

Belum ada Komentar untuk "How to Track Button Click in Google Tag Manager"

Posting Komentar

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel