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.
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:
- Install the MonsterInsights Plugin
- Track Call-to-Action Buttons in WordPress
- Track eCommerce Buttons in WordPress
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.
Type in your license key and then click Connect MonsterInsights to quickly connect your WordPress site to Google Analytics.
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 as a separate entity. This lets you easily see which ones are receiving the most clicks.
To add a custom event to a CTA button, you’ll just 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. If you don’t specify this, MonsterInsights will use the destination link here.
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.
These 3 tags correspond to the tabs in the Events tab in Google Analytics:
So by using these, we can track the links right 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="https://wpforms.com/blog" 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.
Over time, you’ll be able to see how many times Add to Cart was clicked over the time period you select.
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.
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.