Latest SeedProd News

WordPress Tutorials, Tips, and Resources to Help Grow Your Business

How to Set Up Link Tracking in WordPress (the Easy Way)

How to Track Link and Button Clicks in WordPress (Step by Step) 

Written By: author avatar Stacey Corrin
author avatar Stacey Corrin
Stacey Corrin is a certified content marketing and search specialist with over 15 years of experience writing about WordPress, SEO, and digital marketing. She manages content for SeedProd and RafflePress, covering tools and strategies she actively uses and tests herself.
    
Reviewed By: reviewer avatar Turner John
reviewer avatar Turner John
John Turner is the co-founder of SeedProd. He has over 20+ years of business and development experience and his plugins have been downloaded over 25 million times.

TL;DR: Track Link and Button Clicks in WordPress

Track link and button clicks in WordPress using MonsterInsights, a Google Analytics plugin that handles event tracking automatically inside your WordPress dashboard.

  1. Install MonsterInsights – connect it to Google Analytics using the setup wizard
  2. Track affiliate links – add your link prefix under Insights » Settings (Pro required)
  3. Track outbound links – automatic on all plans; view under Insights » Reports
  4. Track file downloads and form buttons – automatic for common types; install the Forms addon for form submit tracking
  5. Track tel: and mailto: links – automatic; check GA4 under Reports » Engagement » Events
  6. Track custom links – add data-vars-ga attributes to any HTML link, available on all plans

Pro Tip: After each setup step, open Google Analytics and go to Configure » DebugView to confirm the event fires before you rely on the data.

You changed your CTA button last month. You added an affiliate link. You started offering a new download. But if you’re not tracking link clicks in WordPress, you don’t know which of those changes actually moved the needle.

I remember trying to figure this out on one of my first WordPress sites. I had buttons, links, and forms all over the place, but no clue what was working.

That’s where link tracking comes in. Learning how to track link and button clicks in WordPress shows you what people actually click, where they drop off, and what drives real results.

In this guide, I’ll show you how to track affiliate links, button clicks, file downloads, and more. All from inside your WordPress dashboard. No coding required.

Buttons and links are two of the main ways people interact with websites and content online. Plus, it’s those elements that lead users to take action, such as:

Learning how people use the different elements on your website helps you know what is and isn’t working. For example, if people aren’t clicking your subscribe button for your newsletter, you can find out what’s stopping them from doing so.

You can also use link tracking for your affiliate links. For instance, you can learn which affiliate links people click on more than others.

With the insights you gather from tracking links in WordPress, you can make decisions based on real data. If you want a broader view of site performance beyond link clicks, see our list of the best web analytics tools for WordPress.

Now that you know why tracking links on your website is important, let’s learn how you can easily set it up in WordPress.

One of the best tools for collecting data about your website activity is Google Analytics. Yet, even though it has improved over the years to be less complicated, it’s still an intimidating tool for beginners.

That’s why, for this article, we’ll be using MonsterInsights, the best Google Analytics plugin for WordPress. It gives you the ability to easily set up Google Analytics and helps you get the most from the broad range of data it collects.

MonsterInsights Google Analytics plugin in WordPress admin dashboard

Besides adding a simple analytics tracking script in your website footer, MonsterInsights adds the correct event tracking to all the links, buttons, cart areas, etc. on your site. Plus, it shows you easy-to-understand reports right inside your WordPress dashboard.

There’s a free version of MonsterInsights for website owners who want to try it out. But you’ll at least need the Pro version to make use of all its’ powerful tracking features.

Adding MonsterInsights to WordPress is also super-easy.

First, install and activate the MonsterInsights plugin. If you need help with this step, follow these instructions on how to install a WordPress plugin.

After activating the plugin, head to Insights » Settings and enter your license key.

MonsterInsights license key entry field in Insights Settings page

Then scroll down to the bottom of the same page and click the Launch Setup Wizard button.

Launch Setup Wizard button in MonsterInsights Settings to connect Google Analytics

You can then follow the instructions in the launch wizard to connect your website to Google Analytics.

If you need more detailed instructions, you can follow our step-by-step guide on how to add Google Analytics to WordPress.

The MonsterInsights setup wizard will automatically install all the right tracking settings based on the type of website you own.

Now that you’re all set up, let’s explore the different ways you can set up link tracking in WordPress.

Many WordPress websites use affiliate marketing to monetize their content. So it’s your job as an affiliate marketer to learn what your affiliate links are doing.

Plan needed: MonsterInsights Pro or higher for affiliate link prefix settings and Publisher reports.

While it’s possible to track your earnings from third-party websites and resources, this won’t give you a full picture of how people use your affiliate links.

For that purpose, many affiliate marketers use link cloaking plugins to create shorter links they can manage inside WordPress. Usually, the link will look something like this:

https://youwebsite.com/refer/awesomeproduct/.

I use Thirsty Affiliates for my own affiliate links, and MonsterInsights picks up the clicks automatically once the prefix is set. No extra configuration needed beyond adding the link prefix.

And the best thing is, MonsterInsights makes it easy to track those affiliate links right inside WordPress.

All you need to do is head to Insights » Settings from your WordPress admin area and click the Publisher tab at the top of the page.

Affiliate link prefix field in MonsterInsights Publisher settings for tracking affiliate clicks

You’ll then see an area where you can add your affiliate link prefix.

After that, click the Save Changes button to store your settings.

It may take a few hours to collect your data. When it’s ready, you can see your affiliate link insights in the Publisher report section, which you can find by navigating to Insights » Reports in WordPress.

MonsterInsights Publisher report showing top affiliate link clicks in WordPress dashboard

To confirm it’s working, open Google Analytics and go to Configure » DebugView. Click an affiliate link on your site, and the event should appear within seconds. You can also check near-real-time data under Insights » Reports in WordPress.

Outbound links in WordPress are links that point to external websites. They could also be uncloaked affiliate links, links to other websites you own, or links to your partner websites.

Plan needed: Outbound link tracking is automatic on all MonsterInsights plans. No setup required.

MonsterInsights will automatically track all clicks on your outbound links. It’s easy to view them by navigating to Insights » Reports and clicking the Publisher tab at the top of the page.

MonsterInsights outbound link tracking report showing top external links clicked by visitors

If you notice lots of clicks to external websites, reaching out about a partnership is worth it. And if certain links aren’t getting clicks, our guide to call-to-action best practices can help you improve them.

To verify outbound tracking is live, go to Configure » DebugView in Google Analytics and click an external link. The event appears under the name click in the debug stream.

3. eCommerce Tracking in WordPress

If yours is an eCommerce business that uses WooCommerce, you can take advantage of MonsterInsights’ detailed eCommerce tracking features. To do this, you’ll need to install the eCommerce addon for your website.

Plan needed: MonsterInsights Plus or higher, plus the eCommerce addon.

To do that, navigate to Insights » Addons from your WordPress dashboard and scroll down until you find the eCommerce Addon. Click the Install button to install the addon and activate it on your website.

MonsterInsights eCommerce addon in Addons screen with Install button

MonsterInsights will automatically detect any eCommerce software installed on your website and will enable tracking for it.

To view your eCommerce tracking reports, head to Insights » Reports and click the eCommerce tab at the top of your screen.

MonsterInsights eCommerce report showing conversion rate, revenue, and transactions overview

At the top is an overview of all your eCommerce conversions. Underneath are the top referral sources and the conversions and revenue for each source.

MonsterInsights eCommerce report showing add-to-cart events and referral source revenue

Analyzing this data will help you discover which referral sources you should capitalize on and those that aren’t doing so well.

To confirm eCommerce tracking is live, add a test item to your cart. Then go to Configure » DebugView in Google Analytics. You should see an add_to_cart event fire within seconds.

4. Tracking File Download Button Clicks in WordPress

If you run a membership website that sells digital products and downloadable content, then tracking your file download buttons will help you learn how users interact with your files.

Plan needed: Common file types track automatically on all plans. Adding custom file extensions requires MonsterInsights Pro.

MonsterInsights tracks file downloads automatically for popular file types such as:

  • PDFs
  • Spreadsheets
  • Documents
  • Presentations
  • Zip files

But if there are other file types you wish to track, you can easily set it up.

To do that, head to Insights » Settings and click the Engagement tab. Then scroll down to the bottom of the page to the File Downloads section.

MonsterInsights file download settings showing file extension input field under Engagement tab

In this area, you can add the file extensions you wish to track. Remember to click the Save Changes button when you’re done.

Viewing your file download statistics is just as easy. Just click Insights » Reports and click the Publisher tab.

MonsterInsights file download click report under Publisher tab in WordPress dashboard

To confirm download tracking is live, click a file link on your site, then open Configure » DebugView in Google Analytics. You should see a file_download event fire within a few seconds.

5. Tracking Form Submit Button Clicks in WordPress

Forms are an important part of any website. They’re used for newsletter signups, product purchases, orders, and contact forms.

You need to learn how people interact with your forms to see what is and isn’t working. Looking at your form data shows you which forms convert best and which ones need work.

Plan needed: MonsterInsights Pro and the Forms addon.

To track form submit button clicks in WordPress with MonsterInsights, head to Insights » Addons. Then install and activate the Forms addon.

MonsterInsights Forms addon in Addons screen with Install button

After installing the addon, MonsterInsights automatically finds all the forms on your website and will start collecting interaction data.

The addon works with all popular WordPress form plugins like WPForms, Formidable Forms, etc.

Once MonsterInsights has gathered enough data, you can view your form reports by heading to Insights » Reports and clicking the Forms tab.

MonsterInsights form report showing form impressions, conversions, and conversion rate

To verify form tracking is active, submit a test entry on one of your forms. Then check Configure » DebugView in Google Analytics for a form_submit event. If it doesn’t appear, confirm the Forms addon is activated under Insights » Addons.

While tracking your form conversions is a great way to learn how people interact with them, not everyone uses a form to get in touch with your business.

Plan needed: Tel and mailto link tracking is automatic on all MonsterInsights plans.

This is why it’s also important to track links for your phone number and email address.

On most websites, any clickable links to your phone number start with tel: and they’ll normally look something like this:

<a href="tel:123-456-789">Click here to call us</a>

Clickable links to email addresses start with mailto: and might look something like this:

<a href="mailto:yournme@yoursite.com">Click here to email us</a>

The great thing is MonsterInsights tracks clicks for tel and mailto links automatically.

In Google Analytics 4, go to Reports » Engagement » Events and look for events labeled click. Filter by the event parameter link_url to see which tel and mailto links were clicked.

GA4 Events report in Google Analytics showing tel and mailto link click events tracked by MonsterInsights

If you click any link in that view, you can see the link URL. This gives you an easy way to track tel and mailto links for any phone number or email address on your site.

To confirm these are tracking, tap a phone number or email link on your site and open Configure » DebugView in Google Analytics. Look for a click event with a link_url parameter starting with tel: or mailto:.

By now, you’ve learned how to track link and button clicks in WordPress. But what if you have a specific custom link you want to track and create custom reports for?

Plan needed: Custom link attribution using data attributes works on all MonsterInsights plans.

MonsterInsights can help you with that, too, with the attribution feature.

To set this up for any link on your website, just switch to the HTML view in the WordPress block editor and add your link in this format:

<a href="https://www.example.com" data-vars-ga-category="Call to action clicks" data-vars-ga-action="CTA link click" data-vars-ga-label="Homepage CTA clicks">My custom link</a>

As you can see, the above link has 3 new link attributes, including:

  1. data-vars-ga-category: to create a category for your link
  2. data-vars-ga-action: for describing the action the link performs
  3. data-vars-ga-label: A label that helps you identify the link

In Google Analytics 4, find your custom link data under Reports » Engagement » Events. Look for events matching the category name you set in data-vars-ga-category.

To verify a custom link is tracking, click it and open Configure » DebugView in Google Analytics. You should see the event fire with the category and label you assigned.

Next Steps

Now that you’ve set up link tracking in WordPress, you can see what’s working, what’s being ignored, and what actually drives results. The next step is putting that data to work. Our guide on how to convert website visitors into customers shows you how.

If you’re ready to take things further, I recommend two tools I’ve used myself:

  • MonsterInsights Pro – for deeper insights like eCommerce tracking, form conversions, and custom link reports
  • OnePageGA – a clean GA4 dashboard that skips the noise and shows you just the stuff that matters

Or, if you’re still exploring, check out our tutorial on how to track logged-in user activity.

And don’t forget to follow us on Facebook and Twitter for more helpful tips and tutorials.

author avatar
Stacey Corrin Content Marketing Specialist
Stacey Corrin is a certified content marketing and search specialist with over 15 years of experience writing about WordPress, SEO, and digital marketing. She manages content for SeedProd and RafflePress, covering tools and strategies she actively uses and tests herself.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. We only recommend products that we believe will add value to our readers.