MARKETING

How to track button clicks on Google Analytics

March 24, 2023
12 mins

You've done it! Hours and hours of work have finally come to an end and your brand new website or mobile app is now live.

Much like a first-time parent, you want to show off your new 'baby.' But will this pride and joy of yours truly be successful? And how will visitors engage with your site?

Are the clicking points too tricky for them to find? Do they scroll down to the desired point on a page? Are users navigating between pages in the way you intended them?

These interactions are known as events in Google Analytics. Granted, there are many different kinds of events, but in this article, we're talking about button clicks when we refer to events.

Web developers and business owners need to know the answers to the questions mentioned above. You see, understanding the success rate of these events helps you build a strong, reliable website that users find easy to navigate and achieves the desired result.

Before we discuss tracking button clicks, let's first figure a few things out:

  • Is there any other software that I need to familiarize myself with before I can track button clicks?
  • What are some examples of button clicks that can be followed?
  • Which of these events or buttons are the most important ones I should follow?
  • How do I start tracking them?

So then, let's begin with familiarizing ourselves with the software.

Google Tag Manager

Black phone with a Google chrome symbol.
Source: Pexels.com

Google tag manager is a Tag Management System (TMS) developed by Google and originally released in 2012.

At the time of writing, the most up-to-date paid version of this software is Tag Manager 360, while the free version, Google Tag Manager, would be more suitable for small businesses.

This software allows users to configure and immediately use tags on a given website.

The free Google Tag Manager account boasts multi-user support, rule-based triggers, and support for Google and Non-Google Tags. However, it has a limit of three workspaces available for simultaneous tagging projects.

Take the time to read about tag manager and study its features before setting up your event tracking parameters. (1)

Pro tip: Tag manager works best when used in conjunction with Google Chrome, so make sure you adjust your browser settings if needed.

What are some button clicks that I could track with Google tag manager?

A lady holding a computer mouse while sitting in front of a desktop computer.
Source: Pexels.com

Depending on the nature of your business and the design of your website or app, there will be various button clicks available for tracking.

If you have an e-commerce web page, you will focus your button tracking on call-to-action events. You want to track how many users follow through with a purchase or how far they browse on your site before they lose interest.

Name your buttons appropriately - Add to cart / Get it now / Subscribe / Book Now / Submit button.

By using the tag configuration setting in your Tag Manager, you'd be able to name each button click and understand your website visitors better.

Not all websites would be tracking the same user clicks. That is because pages and apps are designed with different reasons in mind. 

A blog post geared heavily toward advertising would be tracking outbound link clicks or perhaps file downloads. You'd also want to track video engagement so you could set up an event tag that would let you know which video's have success on your page and adjust accordingly.

A laptop and miniature trolley with cash in it
Source: Pexels.com

How do I set up the tracking?

Once you're familiar with the Google Tag Manager, you can use it to track your button clicks. It's a bit of a process to set it up, but the same steps are used for any new tag or click event you'll set up in the future, so it's not too painful.

Here's a step-by-step guide.

  • Enable click variables in Google Tag Manager

Once you've logged in to your Google Tag Manager workspace, navigate to variables and click on configure.

Tag manager has a selection of built-in variables to choose from and they will appear on the pop-up page. For example, you can choose from any or all of the following:

  • Click element
  • Click Classes
  • Click ID
  • Click Target
  • Click Url
  • Click Test

Pay attention to your selection here, as Tag Manager uses this to identify the click parameters for each button you intend to track.

  • Configure Click elements as Triggers

You now need to configure these click elements to create a trigger. Do that by navigating to triggers in your tag manager workspace.

Click on add new trigger, select all elements and click on all clicks.

It's helpful to select all clicks at this stage, even though you won't necessarily want to track all button clicks during your data sampling in Google Analytics. This is because you need to first identify the unique parameters of the individual button you intend to track.

You can come back to this step later on and adjust as needed.

  • Set a variable for the button click to be tracked

Google tag manager workspace will now give you the option to preview the changes you've just made. Preview mode is a convenient feature in Tag Manager as it allows you to browse a site and preview all the changes you've made before you hit save and the changes are published.

You can then use this debugging feature to inspect the order in which your tags fired.

So, click on preview and then enter your domain URL values to begin the debugger. Your set button will then appear in the domain tab. Click on it.

Once you click on it, you will see the debugger running. The debugger will then monitor all actions performed by the trigger fires.

The intention of this exercise is to find and set parameters for each button click.

Settings tab on a computer screen. Google Analytics settings can easily be changed to add an event.
Source: Pexels.com

  • Adjust the trigger accordingly in Tag Manager

Think of these triggers as listening to your website. It detects specific actions like submissions, button clicks, and page views. The trigger will then tell the tag to fire when a particular activity is detected.

Tags and triggers go hand in hand, so each tag needs a trigger to fire. So be sure to use the trigger configuration option to adjust it accordingly.

Do this by navigating to Triggers, selecting your desired trigger, and then changing the trigger configuration from All clicks to Some clicks.

You can then select a unique identifier for the trigger.

  • Create a new event tag

You've just set up a new tag to be monitored, right? Well, now you need to tell the Analytics platform to track this. Do this by setting up Google Analytics Event Tracking.

In your workspace, go to Tag -> New -> Tag Type = Google Analytics Universal Analytics -> Track Type = Event

You will now have the option to add an event category, action, or label. Choose one that makes sense to what you're trying to achieve and select the trigger you've just modified.

Click Save.

  • Submit and save the changes

At this stage, you're ready to have your modification applied to your website or app, so in the main menu, click on Submit and the triggers on your tag will be activated.

A man creating events on his laptop using Google Analytics
Source: Pexels.com

  • Enable your Google Analytics account to recognize the event

Now that you have done all this work, you need to update Google Analytics to recognize the event.

After logging in to your Google Analytics account, go to Admin, select Goals, and then Create New Goal.

In this view, you'll have the option to give your goal a name, configure the goal type, and set the event conditions.

Test the click tracking in your Google Analytics account

It's essential to test the button click tracking that you've just set up, as you need to know how these triggers respond to actions on your page in real-time. There are different ways you can do this. Let's look at two options.

Test your button click tracking in Google Tag Manager.

We've already spoken about the debugger or preview mode that Tag Manager offers. Here you can see if the tag is 'firing.'

Do this by clicking on Preview and selecting Connect to site. Then select the desired button you want to track in Google Analytics. From here, navigate to Debugger / Tag assistant data and select Tags.

You will then see the tags that have and have not been fired.

Test your button click tracking in Google Analytics.

First, you'll need to simulate your button click on the website you're analyzing. Then, log in to your Analytics account and navigate to Real-time, and select Events.

This will enable you to view the button click goal and see whether or not it is firing correctly.

"Google Analytics was too complicated. I save 2 hours every week with Abralytics."

Ryan McK - Founder of Subversive Design Agency
No credit card required
Cancel anytime

Abralytics - Button click tracking made easy

In an ideal world, everyone would have the time, know-how, and patience to set up and configure their analytics software. Nobody would have to choose between time spent on tag configuration and sipping on a freshly brewed cup of coffee.

Abralytics is an analytical software that makes that choice just a bit easier.

Unlike most analytics platforms that require the user to set up each button-click event manually, we automatically detect these in your app and store them as events. Simply put, there's nothing for the user to do to enable this feature.

Interested in hassle-free button click tracking? Sign up for a free trial here while you take another sip of the good stuff...

You might be interested in this article:


How to delete goals in Google Analytics

Get hot analytics trends straight to your inbox.

Signup for the free newsletter.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Get better analytics today.

Start your 30-day free trial