How to Set Up Link Tracking in WordPress (the Easy Way)
Do you want to track links and button clicks in WordPress?
Setting up link tracking for WordPress helps you learn how people use your website. With that information, you can then plan a strategy to improve your site’s user experience, click-through rates, and conversions.
In this tutorial, we’ll show you how to set up link tracking in WordPress, so it’s easy to get the data you need for growing your business.
Why You Should Track Links in WordPress
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:
- Signing up for your email newsletter
- Buying a product
- Subscribing for a service
- Registering for a webinar
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 more than others.
With the insights you gather from tracking links in WordPress, you can make decisions about your business based on real data to drive its success.
Now that you know why tracking links on your website is important let’s learn how you can easily set it up in WordPress.
Setting Up Link Click and Button Click Tracking 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.
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.
After activating the plugin, head to Insights » Settings and enter your license key.
Then scroll down to the bottom of the same page and click the Launch Setup Wizard button.
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.
1. Tracking Affiliate Links in WordPress
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:
But 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.
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.
2. Tracking Outbound Links 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.
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.
If you notice many clicks to external websites, it might be a good idea to contact them. You could set up a mutually beneficial partnership for both sites, like sponsorship or affiliate partnerships.
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 enable eCommerce tracking for your website.
First, visit your Google Analytics dashboard and click on the Admin icon in the bottom-left corner.
Next, click the eCommerce Settings option in the right-hand column.
You’ll then see a screen with the option to turn on eCommerce tracking and enhanced eCommerce tracking in Google Analytics. After enabling those options, click Save.
After that, you can enable the MonsterInsights 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.
Next, head to Insights » Settings and click the eCommerce tab at the top of your screen. On this page, turn on the Use Enhanced eCommerce option.
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.
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.
Analyzing this data will help you discover which referral sources you should capitalize on and those that aren’t doing so well.
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.
MonsterInsights tracks file downloads automatically for popular file types such as:
- 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.
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.
5. Tracking Form Submit Button Clicks in WordPress
You need to learn how people interact with your forms to see what is and isn’t working. Plus, looking at your form data will help you see which forms convert the best and which ones need more work.
To track form submit button clicks in WordPress with MonsterInsights, head to Insights » Addons. Then install and activate the Forms addon.
After installing the addon, MonsterInsights automatically finds all the forms on your website and will start collecting interaction data.
Once MonsterInsights has gathered enough data, you can view your form reports by heading to Insights » Reports and clicking the Forms tab.
6. Tracking Tel and Mailto Links in WordPress
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.
This is why it’s also important to track links for your phone number and email address.
In 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:firstname.lastname@example.org">Click here to email us</a>
The great thing is MonsterInsights tracks clicks for tel and mailto links automatically.
You can see all the details in the Event Category view inside Google Analytics.
If you click any link in that view, you can see links’ content. This gives you an easy way to track tel and mailto links for various phone numbers and email addresses on your WordPress website.
7. Tracking Custom Links in WordPress
By now, you’ve learned how to set up link tracking and 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?
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:
- data-vars-ga-category: to create a category for your link
- data-vars-ga-action: for describing the action the link performs
- data-vars-ga-label: A label that helps you identify the link
You can find the reports for custom link tracking in the Behavior » Events Section of Google Analytics.
We hope this article helped you learn how to set up link tracking in WordPress. Now you can track everything from affiliate and outbound links to button clicks, form downloads and eCommerce activity.
Since we’re on the topic of tracking, you might also like to learn how to track logged-in user activity in WordPress.