Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Track Outbound Links in WordPress

One of the key metrics that we track on WPBeginner and our other brands is outbound link clicks. This data helps us see how users are interacting with our site and where they’re clicking.

Outbound links are the links that take users away from your website. These could be links to affiliate products, social networks, or simply other websites that you have linked to from your website.

If you try to set up external link tracking, then you’d need to edit a lot of code. Luckily, we’ve tested lots of analytical tools and plugins that can track them out of the box.

In this article, we will show you how to easily track outbound links in WordPress to see which ones your users click on the most.

How to track outbound links in WordPress

Why Track Outbound Links in WordPress?

After you build your WordPress website, you will need to learn how users interact with your website so you can grow it. The best way to do this is by using Google Analytics.

It allows you to see where your users are coming from, what pages they are viewing, and how much time they are spending on your website. This information helps you adjust your strategy and improve your website accordingly.

Similarly, learning about outbound or external links can help you understand which outgoing links are clicked more often. If you recommend affiliate products, then tracking outgoing links helps you learn which products perform better with your audience.

You can also find new content ideas by tracking outbound links. If people are clicking to view content on another site, then you cover the same topic on your website.

Plus, it helps create new partnerships. You can sign up for affiliate programs, get backlinks, or exchange guest posts with sites where you send a lot of traffic.

Having said that, let’s take a look at how to easily track outbound links in WordPress.

Tracking Outbound Links in Google Analytics

The easiest way to track outbound links in Google Analytics is by using the MonsterInsights plugin.

MonsterInsights is the most popular Google Analytics plugin for WordPress. It allows you to properly connect your website with Google Analytics and set up advanced tracking without touching a single line of code.

MonsterInsights

With MonsterInsights, all you need to do is install the plugin, and it will automatically set up outbound link tracking in Google Analytics. It works out of the box, and there’s no need to perform additional steps to track external link clicks.

First, you will need to install and activate the MonsterInsights plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

For this tutorial, we’ll be using the MonsterInsights Lite version, as it includes outbound link tracking. There is also a MonsterInsights Pro version that offers more tracking features like eCommerce tracking and dashboard reports.

Upon activation, you’ll be redirected to the MonsterInsights welcome screen. Simply click the ‘Launch the Wizard’ button to set up Google Analytics in WordPress.

Launch setup wizard

For complete setup instructions, see our step-by-step guide on how to install Google Analytics in WordPress.

Upon activation, MonsterInsights will start tracking outbound links in Google Analytics. If you’re using the Pro version, then you can unlock the Publishers report and see which external links get the most clicks inside your WordPress dashboard.

To view the report, simply head over to the Insights » Reports page and then click the ‘Publisher’ tab. After that, go ahead and scroll down to the ‘Top Outbound Links’ report.

Outbound links report

How to Set Up Affiliate Link Tracking In WordPress

Many WordPress site owners use affiliate marketing plugins to manage and cloak affiliate links. Cloaking allows you to shorten your affiliate URLs and make them more readable, and you can easily track clicks on these links, too.

For example, if you use an affiliate link management plugin like Pretty Links, then you can make your affiliate URLs look like this:

http://example.com/refer/productname/

However, Google Analytics doesn’t track these URLs as outbound links by default because they still have your domain name in the URL. This is where MonsterInsights comes in handy. You can specify the path for your affiliate links, and the plugin will automatically track them in Google Analytics.

To start, simply head over to the Insights » Settings page and then click on the ‘Publisher’ tab.

Edit affiliate link tracking settings

Now, you need to provide the path for your affiliate links. This is the prefix added by your link cloaking or affiliate link manager plugin. For example, if you used ‘refer’ as the prefix, then go ahead and add it under the Path field.

After that, you need to provide a label for those links. This label will be added to your Google Analytics report and will help you identify those links in your reports. Don’t forget to click the ‘Save Changes’ button to store your settings.

Next, you can view your top affiliate links in WordPress using MonsterInsights. Simply go to Insights » Reports and click the ‘Publishers’ tab. Then scroll down to the Top Affiliate Links report and see which links your visitors click most often.

Top Affiliate Links Report

Viewing Outbound Link Reports in Google Analytics

Now that you’ve enabled link tracking on your WordPress site, let’s see how you can check outbound links in Google Analytics.

Remember that Google Analytics could take at least 24 hours to collect and show the data in its reports.

In Google Analytics 4, you’ll need to create a custom report to view outbound link tracking. This can be a tedious task, but you can follow the steps to set up a report.

First, you’ll need to log in to your Google Analytics 4 account and create a custom report to see your outbound link clicks.

To start, you’ll need to go to the Explore tab from the menu on your left and click the ‘Blank’ template.

Create a blank report

Next, you can enter a name for your report under the ‘Exploration Name’ field.

After that, you’ll need to add dimensions for your custom report. Simply click the ‘+’ sign next to Dimensions.

Add a new dimension

On the next screen, you’ll see different dimensions. There’s also an option to search for dimensions at the top.

After that, you can look up the following dimensions in the search bar and click the checkbox to select them:

  • Event name
  • Link text
  • Page title
  • Outbound

Once you’ve selected these dimensions, simply click the ‘Import’ button.

Select dimensions in the report

You will now see them added under ‘Dimensions’ in your custom report settings.

Next, you can drag the ‘Link text’ and Page title’ dimensions and drop them in the ‘Rows’ section.

Drag dimensions to row field

After that, you’ll need to add a metric to your report.

Go ahead and click the ‘+’ sign next to Metrics.

Add a new metric

In the next scene, you’ll see different metrics that you can add to your custom report.

Simply select ‘Event Count’ and then click the ‘Import’ button.

Add event count metric

The event count metric will now be added to the custom report under the Metrics section.

You’ll then need to drag the ‘Event count’ metric and drop it under the ‘Values’ area.

Add event count to values area

Next, you’ll need to drag the ‘Event name’ dimension and drop it in the Filters section.

After that, you can select ‘exactly matches’ from the Filter dropdown menu and then type in ‘click’. Once you’re done, simply click the ‘Apply’ button.

Add event name to filters

In the next step, you’ll also need to add the ‘Outbound’ dimension to the Filters section.

When you add the outbound dimension, go ahead and select ‘Exactly matches’ from the Filter dropdown menu and type in ‘true.’

Add outbound to filters

Don’t forget to click the ‘Apply’ button after entering these details.

That’s it. You’ll now see a custom report that shows which outbound links get the most clicks and from which pages.

View outbound link report in ga4

We hope this article helped you learn how to track outbound links in WordPress. You may also want to see our guide on how to track user journey in WordPress and the 12 reasons your visitors aren’t converting into customers.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

14 CommentsLeave a Reply

  1. Dennis Muthomi

    Wow, this article on tracking outbound links in WordPress is incredibly helpful, WPBeginner!
    I especially liked the instructions for setting up MonsterInsights and creating custom reports in Google Analytics 4.

    One tip I’d like to add for fellow readers: consider using UTM parameters in your outbound links for even more detailed tracking. This can help you understand not just which links are clicked, but also which specific pages or content types are driving those clicks.

    Thanks for consistently providing such valuable, actionable content for the WordPress community!

    • Mrteesurez

      I completely agree, this article on tracking outbound links in WordPress is a gem! Like you, I’ve found MonsterInsights to be an essential tool for getting detailed insights. Adding UTM parameters to outbound links is an excellent tip. I’ve used UTMs in my own campaigns, and they’ve helped me identify exactly which pages and content are performing the best. It’s a simple step that provides a deeper understanding of user behavior, making it easier to optimize future strategies. Thanks for sharing this tip and WPBeginner for the great content!

      • Dennis Muthomi

        Love finding someone else who’s hands-on with these analytics tools! It’s so good to hear you’re getting great results with UTM parameters for tracking campaigns. I’ve been using them too, and they’re seriously game-changing for understanding what’s working.
        Really cool of you to share your experience here and replying :)

  2. Mrteesurez

    This really shows the power of Monsterinsights as it gives me a way to track an outgoing link.
    But one thing is that, can I use Monsterinsights with Google site kit plugin, both aim to connect to Google Analytics, hope there will be no conflict ??

    • WPBeginner Support

      We do not recommend using both plugins at once as that will likely cause issues with double tracking among other issues.

      Admin

      • Mrteesurez

        Thanks for your reply and guidance. I already have Monsterinsights but I found Site kit useful in some other aspects like AdSense, Speed test and so on but when you don’t recommend it, I will stick to only Monsterinsights because it has more features that suite my need.

  3. Ahmed Omar

    by the way, can I make the same for my links that I share on social media, so I track which link is bringing more visitors, instead of outbound links?

    • WPBeginner Support

      MonsterInsights does have the option to set up social media tracking.

      Admin

  4. Mahbub

    Hi,
    I recently download monsterinsight, but it do not have ‘Track outbound clicks and download links” under “Engagement’ section.
    So it is not possible now?

    • WPBeginner Support

      Hi Mahbub,

      It is now called ‘Enable MonsterInsights events tracking’ option. We have updated the screenshot to reflect that.

      Admin

  5. Ash

    Works like a charm

  6. S Adam

    mmmmmmm close but :), i have been searching for a way to append all outbound links eg “&mynewstring=pleasehelp”

    I can not find any info on how you would do this in WP or find a plugin that will do it.

    Any ideas, i looked at those links posted but they wont help.

  7. Patrick

    Thank you for this tutorial. I was able to easily track my links in GA. I ran into one problem though:

    The number of clicks on my links in GA is less than what my plugin (pretty links) shows it to be. Around 20% less.

    Do you have any idea how that can be or what might be the reason?

    Thanks,
    Patrick

  8. hiren

    hi very good article.
    thanks for sharing. keep up the good work.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.