Track Button Clicks in WordPress

How to Track Button Clicks in WordPress (The Easy Way)

Editorial Note: We may earn a commission when you visit links on our website.

Do you want to track button clicks in WordPress? Tracking clicks on your call-to-action buttons can help you to see which buttons are performing best (or worst).

In this article, we’ll show you the easy way to track button clicks with a WordPress plugin. You can view the data in Google Analytics along with your other website statistics.

Create Your WordPress Form Now

Can Google Analytics Track Button Clicks?

Yes, you can absolutely track button clicks in Google Analytics. But if you’ve already looked at button tracking tutorials, you’ll already know that it’s tricky to set everything up.

To set up tracking manually, you might need to write JavaScript and work with Google Tag Manager. There is a much easier way to track button clicks using the MonsterInsights plugin.

It lets you easily add tracking code to your buttons in WordPress so you can track them in Google Analytics without writing JavaScript. There’s more information in our MonsterInsights review.

For this tutorial, you’ll just need to add a few extra tags to the HTML code for your call-to-action button. Let’s go ahead and get started.

How to Track Button Clicks in WordPress

We’ll start by installing the MonsterInsights plugin. Then we’ll walk through the different types of buttons you can track. Here are the steps:

First up, let’s start by installing the plugin.

Step 1: Install the MonsterInsights Plugin

To start, install the MonsterInsights plugin on your website.If you’re not sure how to do this, jump over to this tutorial on how to install a plugin in WordPress.

Next up, you’ll want to activate the plugin on your site. Finally, be sure to complete the setup process in MonsterInsights.

Connect MonsterInsights for button tracking

Type in your license key and then click Connect MonsterInsights to quickly connect your WordPress site to Google Analytics.

Connect MonsterInsights to track button clicks in WordPress

Now we’re connected, let’s look at some of the buttons we can track easily in MonsterInsights.

Step 2: Track Call-to-Action Buttons in WordPress

MonsterInsights tracks affiliate links and outbound links ‘out of the box’.  You can read our article on link tracking in WordPress to learn more about that.

But to track call-to-action (CTA) buttons work best with custom event tracking. Custom event tracking lets you collect detailed information about each button separately.

This lets you easily see which ones are receiving the most clicks. To add a custom event to a CTA button, you’ll need to add 3 snippets of code:

  • data-vars-ga-category – the category to use in the Events area of Google Analytics.
  • data-vars-ga-action – the link action. MonsterInsights will use the destination link here if you don’t specify this.
  • data-vars-ga-label – the label. If you don’t specify this, it will default to the link title if there is one, and then the text on the button if there’s no title.

So, by using these, we can track the links alongside the event information MonsterInsights already tracks.

Let’s put it all together. Using all 3 tags on a CTA button, this is what the code might look like:

<a class="ctaButton" href="" data-vars-ga-category="CTA Buttons" data-vars-ga-action="CTA" data-vars-ga-label="Blog CTA Button">Click Here to Visit Our Blog</a>

We bolded the 3 links so you can see them in action. And that’s it! When you add these 3 tags to your link, MonsterInsights will track the CTA button and report the results in Google Analytics.

You can then create custom goals to track your CTA button results. To learn how to analyze button tracking and add dimensions to the results, check out this guide to tracking custom events in Google Analytics.

Next up, let’s look at a special type of button tracking for eCommerce sites.

Step 3: Track eCommerce Buttons in WordPress

Do you want to track the activity on your eCommerce store? Maybe you’d like to see how many times the Add to Cart button is being clicked.

Using the eCommerce addon for MonsterInsights, you can see this right in the WordPress dashboard.

The eCommerce addon starts collecting eCommerce button clicks as soon as you install it.

Activate MonsterInsights eCommerce addon for button tracking

Over time, you’ll be able to see how many times Add to Cart was clicked over the time period you select.

eCommerce button tracking in Google Analytics

The eCommerce addon tracks all kinds of information about your store. For example, you can instantly see your conversion rate, revenue, and average order value.

eCommerce button and conversion tracking in WordPress

MonsterInsights has tons of cool tracking features that you can use to understand more about your customers. That way, you can optimize your site for better conversions.

To learn more, jump over to our guide to using WooCommerce and Google Analytics together. We also have a handy list of the best WooCommerce plugins for your store.

And if your conversion rate is a little on the low side, you’ll want to think about ways to reduce cart abandonment.

PushEngage lets you easily create browser notifications for WooCommerce that can help to encourage customers to complete their purchase.

Create Your WordPress Form Now

Next Step: Track Form Conversions in WordPress

Now you know how to track button clicks in WordPress, you’ll also want to track your form submissions.

This is super easy to set up with the form conversion tracking addon for MonsterInsights. And it’s super easy to use with WPForms.

To get started, check out our guide to tracking WordPress form conversions with MonsterInsights. You can also:

Ready to build your forms? Get started today with the easiest WordPress form builder plugin. WPForms Pro includes lots of free templates and offers a 14-day money-back guarantee.

If this article helped you out, please follow us on Facebook and Twitter for more free WordPress tutorials and guides.

Using WordPress and want to get WPForms for free?

Enter the URL to your WordPress website to install.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.