How to Set Up Affiliate Link Link Tracking in WordPress

How to Set Up Affiliate Link Tracking in WordPress

Do you use affiliate programs to monetize your site? Do you want to learn how to set up affiliate link tracking in WordPress and Google Analytics?

Using Google Analytics can be tricky, especially for beginners. Luckily, with MonsterInsights, you can tell Google Analytics to track affiliate link clicks on your site in just a few steps.

In this article, we’ll show you how to set up affiliate link tracking in WordPress and Google Analytics.

Start Tracking Your Affiliate Link Clicks Today!

MonsterInsights is the best WordPress Analytics plugin. Get it for free!

Table of Contents

We’ve divided the post into different sections, so you can jump ahead to any part you’re interested in:

Let’s kick things off…

Benefits of Affiliate Link Tracking on WordPress

Affiliate marketing is a great way to make more money online. You can sign up for different affiliate programs and promote products for different solutions.

The best way to track your affiliate links is through MonsterInsights. It’s the best WordPress plugin for Google Analytics, and you get affiliate link tracking right out of the box.

Here are the benefits of setting up affiliate link tracking:

1. Track All Affiliate Links in a Single Location

As an affiliate marketer, you might want to promote several products that use different affiliate programs like Commission Junction, Amazon Associates, and ShareASale. Or, you may have different affiliate products listed on your WooCommerce store.

With MonsterInsights affiliate tracking, you can see how much traffic you send to each product or site from a single report, regardless of which affiliate program you’re using.

You get to see how each affiliate is performing at a glance without leaving your WordPress dashboard.

track affiliate link click

2. Earn More Affiliate Revenue by Comparing Traffic vs. Revenue

Imagine you’re promoting 2 rival products (Product X and Product Y) on your site, and you’re making more revenue from Product X than Product Y.

But from the affiliate tracking report in Google Analytics, you realize that you’re actually sending more traffic to Product Y.

affiliate link tracking comparing rival products

This means that if you work on sending more traffic to Product X (which is a highly converting product), you could earn more affiliate revenue.

Without an affiliate tracking report, you won’t be able to easily review the number of visitors you send to each product. That’s why tracking each affiliate helps you optimize your site to grow your revenue.

3. Give Prominence to High Performing Affiliates

Another benefit of an affiliate tracking report is that it lets you see how many clicks your affiliate links are receiving per page.

Imagine you’re promoting 10 different products in a listicle and figured out the product you placed in the 4th position in that article is receiving more clicks than the product you placed in the first position.

This clearly shows that you might want to lower the position of the first product because not many of your readers are interested in that product.

That way, you can send more traffic to the product that converts better and generates more revenue.

With that, let’s see how to track affiliate links in Google Analytics.

How to Track Affiliate Links in Google Analytics

Follow these steps, and you’ll be able to see more data on your affiliate links.

To track affiliate links in Google Analytics and WordPress:

  1. Install and Activate MonsterInsights
  2. Redirect Affiliate URLs with Pretty Links
  3. Set up Affiliate Link Tracking in MonsterInsights

Step 1: Install and Activate MonsterInsights

First, you’ll need to install MonsterInsights on your WordPress website. MonsterInsights allows you to set up affiliate link tracking in WordPress with just a few clicks – no need to modify your Google Analytics code.

monsterinsights wordpress plugin

To get affiliate link analytics, grab MonsterInsights at the Plus level or above, then download the plugin from your Account page.

Next, upload the plugin on your WordPress website by going to Plugins » Add New » Upload Plugin and then click the Install Now button.

Now, activate MonsterInsights by clicking the Activate Plugin button.

activate monsterinsights

After installing and activating the plugin, you’ll need to connect it with Google Analytics. The MonsterInsights setup wizard makes it super simple to add Google Analytics tracking code to your website.

connect monsterinsights with ga

For more details on how to get set up, read our step-by-step guide on how to set up Google Analytics on your WordPress website properly.

Step 2: Redirect Affiliate URLs with Pretty Links

To install the Pretty Links WordPress plugin, go to your website’s dashboard and then click Plugins >> Add New. Then search for Pretty Links and click Install Now.


Once you install the plugin, it should appear in your WordPress dashboard. Click on Pretty Links to view their welcome screen.

Next, click Add New to enter an affiliate link to Pretty Links.

add new affiliate in pretty links

Now, you get to set up your link.

What you need to do here in order for MonsterInsights to track your affiliate links is redirect all your ugly affiliate links to URLs that include the same path.

Let’s pretend that your website is and you’ve got affiliate links for MonsterInsights on your site. MonsterInsights’ affiliate program is through ShareASale. So, your affiliate link to MonsterInsights will look something like this:

With Pretty Links, you can redirect that link and make it whatever you want it to be. You create a new URL on your own domain, then redirect it to your ShareASale link.

For instance, your new URL might be

Here’s a look at how this is going to look in Pretty Links:

Affiliate link setup example in Pretty Links

Now, your users will click on:
And be redirected to:

Note: Make all your links have the same path in them. We used /affiliate/ above, then the product name. You could also use /refer/product-name or /go/product-name, or whatever you prefer.

Step 3: Set Up Affiliate Link Tracking in MonsterInsights

Now that your affiliate links are redirected to pretty URLs, you can set up tracking in MonsterInsights.

Navigate to Insights » Settings, and click on the Publisher tab at the top of the page, and then to the Affiliate Links section.

We used /affiliate/ in the link we created above, so that’s what we want to track with MonsterInsights. Put /affiliate/ or whatever URL path you chose in the Path box, then a Label. The Label is what appears in Google Analytics, so you can make it whatever you want.

You can track multiple different paths, so you can organize different links however you’d like.

MonsterInsights Affiliate Settings

After filling in these 2 fields, you can click Save Changes.

After that, MonsterInsights will automatically start to track the affiliate links you told it to track.

Now, let’s go over how to view your affiliate link tracking report.

How to View Your Affiliate Link Tracking Report

Now, you can see the report inside your WordPress dashboard using MonsterInsights. It brings your important Google Analytics data to your admin area, and you don’t have to leave your website.

Go to Insights » Reports » Publishers and scroll down to Top Affiliate Links to see the report.

Top Affiliate Links Report in MonsterInsights

And if you want to view the report in Google Analytics, click the View All Affiliate Links Report button in MonsterInsights or log in to your Analytics account and go to Behavior » Events » Top Events. Or, if you’re using GA4, find the report under Reports » Engagement » Events.

affiliate link top events

Now, let’s find out how to track WooCommerce affiliate links in WordPress.

How to Set Up WooCommerce Affiliate Link Tracking

Besides affiliate links in your content, if you have a WooCommerce store and have different external/affiliate products on your online store, MonsterInsights will automatically track them.

To start, enter the URL of your affiliate link in WooCommerce by going to Products » Add New and scroll down to the product data meta box.

Next, select External/Affiliate product from the drop-down menu, enter a product URL, button text, and regular price. Once that’s done, Publish your product.

woocommerce affiliate link tracking

MonsterInsights will now automatically track WooCommerce affiliate link clicks. You can view the report in your WordPress dashboard by going to Insights » Reports » Publishers » Top Affiliate Links and see which affiliate is getting the most clicks.

woocommerce affiliate link report

That’s it!

Using MonsterInsights, you can now see how your affiliate links perform and use the data to grow your revenue.

Start Tracking Your Affiliate Link Clicks Today!

We hope this article helped you set up affiliate link tracking in WordPress.

We bet you’d also like to read Best Affiliate Plugins for WordPress!

Plus, if you’re monetizing your blog with AdSense, you can learn how to optimize your ads using Google Analytics.

And don’t forget to follow us on Twitter, Facebook and YouTube for more helpful Google Analytics tips.

Want to Try MonsterInsights for Free?

Enter the URL of Your WordPress website to install MonsterInsights Lite.


  1. Do you support other affiliate link plugins too? (other than Pretty Links) For example many of our clients use ThirstyAffiliates link cloaker, would the tracking work with that too?

  2. Hello, thanks for this tutorial but I’m a little lost at step 2 (How to Track Affiliate Links in Google Analytics). I have everything set up (Google Analytics, Pretty Links, and MonsterInsights). How and where do I add the prefix? Currently, my affiliate links show up as “”. Thank you for your help.

    1. Hello, you can add the prefix in MonsterInsights settings. Just go to Insights » Settings » Publisher and scroll down the Affiliate Links section. Let us know if you have more questions 🙂

  3. I too am completely baffled by Step 2. I have a wordpress site, and I have links to Amazon. But where do these /go or /recommend links come from? Those aren’t valid URLs on my WordPress site. Currently I paste the Amazon code into HTML widgets. There seems to be a whole step missing your instructions.

  4. I too am baffled. Can we not use the prefix and still get the report? And can we not use the Pretty Links plugin and still get the report? If so, how? Thank you very much.

    1. Hey Mike! Thanks for stopping by and for your comment. You’ll still be able to find all of your affiliate link clicks in your outbound links report if you don’t cloak them with a page path. They’ll just be in that report instead of the affiliate report. Try clicking the “view all outbound links” blue button at the bottom of the report. If you’d like some help navigating that data to see link clicks by page or something else, please reach out to our support team.

  5. This is an interesting concept, but impractical for me. I already have hundreds of links to track with PrettyLinks. To use this method, I have to change the URL path. That invalidates URLs that I’ve already shared elsewhere, or I have to create a new redirect from the new /go/ path to the existing PrettyLinks URL.

    As I said, that’s impractical unless you start a new site with your affiliate links using the method you’ve prescribed here.

    1. Hey William,
      Thanks for your comment. Do your hundreds of links have a path you’ve set up, like /affiliate/xxxxx, or are they all different/original (like You can set MonsterInsights to use any path that you have. If all your links are not masked, though, you’re right, it would be pretty difficult to track affiliate links this way. If that’s the case, you can still at least see which ones are getting clicked in the Outbound Links report. More on that here:

  6. Sorry – I have to agree with others, this is a fairly bad explanation of how to use this feature. Kinda disappointing.

    Since you have to use Pretty Links anyway, how does this report differ from what the pretty links plugin already provides?

    1. Hi Austin – Thank you for your feedback. We’re sorry you didn’t find this article to be particularly helpful! We value the feedback and will use it to improve this article.

      MonsterInsights takes the affiliate report a step further by actually adding the data to Google Analytics. So, while you’re seeing just the total clicks in your dashboard (which is what Pretty Links also provides), you can click the “View All Affiliate Links Report” button to head over to Google Analytics. Then you can look at more data about those affiliate clicks – my favorite is using it to look at which pages people were on when they clicked those links.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.