Hosting Tutorial & Guide

How to Track the Outbound Links of a WordPress Site

updated on Jun 16, 2017
How to Track the Outbound Links of a WordPress Site You should probably have paid much attention to the inbound links of your WordPress site because of the SEO benefit. Then what about tracking the outbound links?

In fact, outbound link tracking is also important especially in the case that you have integrated social media with your WordPress site or participated in affiliate marketing. Tracking the affiliate links helps you find out the most profitable affiliate products, and tracking the social media links enables you to carry out a more effective social media marketing plan.

The best tool to track your visitors' behaviors, of course, is Google Analytics. So in this tutorial, we will show how to track the outbound links on a WordPress site with this tool.

Track Outbound Links in WordPress

For outbound link tracking with Google Analytics, we'd suggest you use the MonsterInsights plugin. As a great Google Analytics plugin, MonsterInsights comes with useful features including link tracking, ad tracking, and page-level analytics. This tutorial, however, only focuses on the link tracking feature.

Track Outbound Links with MonsterInsights

There is a free version of MonsterInsights which you can use to reach your goal. So first of all, you should install the plugin by visiting Plugins > Add New. When the plugin is activated, you will see an Insights menu item. Now, click Insights > Settings to connect your website with Google Analytics.

MonsterInsights Settings

Under the General tab, there is a Google Authentication option. Clicking on the blue button, you will get a popup in which you can connect your site with a Google account easily. A Google code is needed, while you are able to get it by simply following the guide in the popup.

Google Analytics Auto-Authentication

If the auto-authentication fails, you can also follow the manual authentication link to connect to Google Analytics manually by entering your UA code.

As soon as the authentication succeeds, you can enable the outbound link tracking.

Track the outbound links

On the plugin's settings page, you may have noticed the Tracking tab. Opening the tab, you will see the tracking options. To start tracking your outbound links, simply select "Using Javascript" for tracking outbound clicks.

Also, it is good to ignore some certain user roles from tracking in order to increase the accuracy of the tracking report. Administrator and editor are ignored by default, and you can choose other user roles which are not the normal visitors to your WordPress site.

Enable Outbound Link Tracking

As soon as the changes are saved, Google Analytics starts tracking the clicks of your outbound links and the download links.

Track your affiliate links

Even if you have enabled outbound link tracking, you will not get the reports on the clicks of your affiliate links because Google Analytics doesn't track those links by default. The links like are not considered as outbound links in Google Analytics. However, you will certainly want reports for the links if you earn revenue from affiliate products.

Fortunately, the MonsterInsights plugin provides a fix for this. Under the Tracking tab, there is an "Affiliate Links" section on the left side of the screen. Find and open it. Now you should provide the path that your affiliate links use. In the example given above, the path is /go/. This will make Google Analytics track all links with this prefix as outbound links. Multiple paths should be separated with commas.

Also, it is suggested to add a label like "aff" for the affiliate links you would like to track. This label makes it easier to identify the affiliate links in the tracking reports. When these things are done, save the changes.

Enable Affiliate Link Tracking

View the Link Tracking Reports in Google Analytics

After enabling the outbound link tracking, you will need to wait at least 24 hours before viewing the reports because Google Analytics needs time to collect the statistics you want.

If you use MonsterInsights with the automatic authentication, you will be able to see the tracking reports in the WordPress dashboard directly by going to Insights > Reports. However, in the case that you use manual authentication, you have to read all the statistics in the Google Analytics dashboard.

When you are logged into your Google Analytics account, find Behavior in the menu on the left side, click to expand it, and then click Events > Top Events. In the report, you will find "outbound-link" under the event category. If you are also tracking the affiliate links, you will see one more event category named as "outbound-link-aff". The accurate name depends on the path you give in the plugin's settings.

Top Events

Clicking on an event category, you will see the external links on your site that have been clicked, along with the stats for the total clicks and unique visitors.

Outbound Link Clicks

Besides these stats, you can also view the real-time link activity by going to Real-Time > Events if it is necessary.

Final Thought

MonsterInsights provides an easy way for integrating Google Analytics and tracking the outbound links. In fact, it comes with much more features besides the ones introduced in this tutorial. For example, you can configure the file downloads tracking and enable anchor tracking. The premium version even allows you to track ads and forms, set up Google AMP, and tweak website performance. So be sure to explore more out of this plugin.