WordPress Tutorial Videos by WP101®

175+ WordPress tutorial videos for non-techies.

  • About Us
    • Top WordPress Products
    • Testimonials
  • WordPress Tutorials
    • Intro to WordPress
    • WordPress 101
    • AIOSEO 101
    • WP Mail SMTP 101
    • Easy Digital Downloads 101
    • WPCode 101
    • WP Simple Pay 101
    • RafflePress 101
    • Elementor 101
    • WPForms 101
    • Spectra 101
    • How to Blog Better
    • WooCommerce 101
    • Beaver Builder 101
    • Ninja Forms 101
    • WP Rocket 101
  • Help Forum
    • Hire a WordPress Expert
  • Blog
  • Contact
  • Sign In

How to Track Affiliate Links in WordPress (Full GA4 Guide)

December 24, 2025 Leave a Comment

FacebookTweetLinkedIn
How to Track Affiliate Links in WordPress (Full GA4 Guide)

Want to know which affiliate links are really getting those clicks?

You might be unknowingly wasting a ton of time promoting links that get zero links, while a totally different product you barely think about is secretly generating lots of interest. 

Knowing where your audience is clicking is the first step towards growing your affiliate income. 

That’s why setting up reliable link tracking is so important. This simple process gives you the exact data you need to stop wasting time and start focusing on the affiliate links that truly interest your visitors.

In this complete guide, I’ll walk you through the exact system I use to track affiliate links inside WordPress. I’ll even show you how to build a custom report in Google Analytics 4 (GA4) to organize all that valuable click data for you, and how to track affiliate products in WooCommerce.

By the time you reach the end of this article, you’ll have everything you need to turn your traffic into consistent commissions. 

Why I Track Affiliate Links in WordPress

Tracking your affiliate links lets you see exactly which recommended products your audience clicks on most often. This is the best way to know which products are performing well with your audience, which is absolutely crucial for running a successful WordPress site and making money online.

I’ve found that sometimes the product I expect to be the top seller isn’t, and another product ends up being a consistent earner. I can then focus my efforts on promoting the products that convert and stop wasting time on the ones that don’t. 

This optimization is a huge part of maximizing your affiliate revenue. After all, you can’t improve what you don’t measure.

Tracking your affiliate clicks can also give you ideas for future content. For example, if a specific affiliate link related to email marketing service is getting a ton of clicks, you might create more in-depth content related to email marketing. 

An example of an affiliate tracking report in the WordPress dashboard

You can then promote the existing affiliate link within that new content, or partner with other email marketing providers to acquire additional relevant links.

In some cases, analytics might show that you’re consistently sending a high volume of traffic to a specific merchant. I’ve seen plenty of bloggers use that information to negotiate better commission rates, ask for exclusive deals for their audience, or even start a new, mutually beneficial partnership.

Setting Up Affiliate Link Tracking in Google Analytics

In my experience, the simplest and most effective way to track your affiliate links is by using the MonsterInsights plugin.

How to monitor your affiliate links in the WordPress dashboard

MonsterInsights is easily the most popular way to add Google Analytics to WordPress. It helps you properly connect your site to Google Analytics and set up advanced tracking without having to mess around with any code. For busy affiliate marketers, that’s brilliant. 

To help you make money online, we won’t just be installing a plugin. Instead, I’ll show you how to set up a complete tracking system.

In this ultimate guide, I’ll walk you through all the essential steps:

  • How to cloak your messy affiliate links using a free WordPress plugin.
  • How to configure MonsterInsights to recognize and track those cloaked links.
  • How to see a simple summary report directly in your WordPress dashboard.
  • How to build a detailed custom report in Google Analytics 4. 

If you’re using WooCommerce, then I’ll even show you how to create and track affiliate products within your online store.

By the time we’re finished, you’ll have all the data you need to turn your traffic into commissions.

Cloaking Affiliate URLs with a Dedicated Plugin

If you want to track your affiliate clicks accurately and keep your site looking professional, I highly recommend cloaking your affiliate URLs using a plugin. 

Cloaking means taking that long, ugly tracking link provided by the merchant (often full of numbers and symbols) and turning it into a clean, short link that uses your own domain name.

Why Cloaking is Essential for Tracking

Cloaking is essential for tracking. Let’s imagine I have an affiliate link for a great cloud hosting service. The actual link might look long and confusing, maybe something like: 

http://www.cloud-partner.com/track/linkID=601672&user=123456&code=49337. 

Using a plugin like Pretty Links, I can redirect that entire link to a brand new URL on my own domain such as http://www.mybesttools.com/go/best-cloud-deal. 

When visitors click the cloaked link, Pretty Links will instantly redirect them to the correct partner site.

To correctly track affiliate links, you need a consistent URL structure. For example, you can use Pretty Links to ensure all your cloaked affiliate links share the same path, such as /refer/.

Then, you can tell MonsterInsights to specifically track every click on the /refer/ path and collect all that data in one affiliate report.

Installing Pretty Links and Setting Up the Basics

As I already mentioned, Pretty Links is a popular affiliate link management plugin that lets you redirect all those complex affiliate links to a uniform, clean URL that has a consistent path. 

Even better, you can use the free version of Pretty Links to track affiliate links in WordPress, so this is the plugin I’ll be using in this tutorial.

To get started, install the Pretty Links plugin from WordPress.org. If you’re not sure how to do this, then please see our guide on how to properly install and activate a WordPress plugin. 

Once it’s active, you need to cloak your affiliate links. To do this, go to Pretty Links » Add New Pretty Link.

How to cloak an affiliate link in WordPress

I always start by giving my link a clear, descriptive name in the ‘Add Title’ box. For example, I might call it something like ‘Cloud Hosting Link.’

After that, open the ‘Redirection’ dropdown menu and select the type of redirection you want to use.

The Pretty Links affiliate management WordPress plugin

‘307 Temporary’ is a very common choice. It replaces the messy original URL with a clean, cloaked URL that tells search engines that this link might change in the future. 

This gives you the flexibility to switch affiliate partners or update the underlying destination URL without confusing search engine crawlers or hurting the search rankings you’ve built up on this page.

After making your selection, copy and paste the long, ugly affiliate link into the ‘Target URL’ field.

Then, type the URL you want to use instead into the ‘Pretty Link’ field. Remember to choose a path that’s clear and easy to remember, such as /refer/product-name or /go/product-name. 

For example, if I wanted my final link to look like mycoolsite.com/refer/bluetooth-speakers, I’d just type /refer/bluetooth-speakers into that box.

How to create a branded, user-friendly affiliate URL

Configuring Advanced Tracking and SEO

Next, select the ‘Advanced’ tab. This area lets you add attributes, which are essential for affiliate compliance and search engine optimization (SEO). 

To start, I always check the box next to ‘No Follow’. This tells search engines not to pass any authority to the external site I’m linking to. Since the user is leaving my site, I don’t want to boost that external site’s ranking with my hard-earned authority. 

Creating nofollow links using Pretty Links

I also make sure to check the ‘Sponsored’ box, so Google knows this is an affiliate link. It’s a good practice for maintaining transparency and compliance.

Finally, I check the ‘Tracking’ box. This tells Pretty Links to collect its own click data, which is a great backup for the data we’ll set up in Google Analytics.

Using the 'sponsored' attribute to improve your site's SEO

Saving and Organizing Your Links

And that’s it! Just click the ‘Update’ button and the clean, trackable affiliate link is ready to use. 

The Pretty Links user interface

Simply repeat these steps to register all your affiliate links with Pretty Links. 

The really cool thing about Pretty Links is that it lets you add multiple different paths and organize links exactly how you need. For example, I sometimes use an entirely different path for specific promotions or resources: 

  • I might use /deals/ for time-sensitive, rotating coupon codes.
  • I might use /freebie/ for a link leading to a free eBook or resource from an affiliate partner.

This helps me a lot when analyzing link performance. If I want to see how my coupon codes performed compared to my standard affiliate links, I can easily filter my GA4 reports using that path name. 

Alternatively, you can keep things simple and use the same URL path for all your affiliate links. It’s completely up to you.

Just make a note of the URL path (or paths) you’re using, as you’ll need to enter this exact path into MonsterInsights in a later step.

Setting Up a New GA4 Property (If You Need One)

Before we set up MonsterInsights, you need to have a Google Analytics Property ready.

A Property is essentially a container within your Google Analytics account that holds all the data from a specific source. In our case, that’s your WordPress blog or website.

MonsterInsights works by reading the data sent to your designated Property. Without a Property, you can’t record any of those valuable affiliate clicks. 

To create this all-important Property, log into Google Analytics using your Google account email and password. With that done, click the ‘Admin’ icon in the bottom-left corner.

The Google Analytics dashboard

On this screen, click the ‘Create’ button.

In the dropdown that appears, select ‘Property.’

Creating a new Property in Google Analytics

You can now give this Property a descriptive name, by typing into the ‘Property name (Required)’ field.

I always use something clear and descriptive, such as ‘My Affiliate Site Data.’

Creating a Google Analytics 4 Property

Then, choose the time zone you want your reports to use, and select your reporting currency. It’s important to set the currency now, so you can easily track your earnings later.

That done, click the ‘Next’ button.

How to connect your WordPress website to Google Analytics

Defining Your Business Details and Objectives

On the ‘Business Details’ screen, open the ‘Industry Category’ dropdown and select the option that best suits your website.

Next, click the ‘Business size’ option that matches your company’s scale.

Registering your WordPress blog or website with Google Analytics

After entering this information, click ‘Next.’

On the subsequent screen, select the objective you want to achieve such as generating leads or getting more sales.

Connecting your WordPress website to GA4

After making your selection, click the ‘Create’ button at the bottom of the screen. 

Setting Up the Data Stream

After saving the Property, you’ll need to set up a Data Stream. This stream is what actually sends the information from your site to the Property you just created.

Since you’re connecting to your WordPress blog or website, make sure you click the ‘Web’ button.

The Google Analytics 4 dashboard

Under ‘Website URL,’ type in the address of the site where you want to track your affiliate links.

Under ‘Stream Name,’ give this data stream a descriptive title. I typically use my website’s name so it’s easy to find later. 

Configuring WordPress as your data stream

When you’re happy with the information you’ve entered, click on the ‘Create & Continue’ button. 

That’s it! You now have a working GA4 Property that you can use with MonsterInsights.

Getting Started with MonsterInsights

Once you’ve created a GA4 Property, it’s time to set up tracking in MonsterInsights.

First, you’ll need to install and activate the MonsterInsights plugin. 

For this guide, I’ll be using the premium version of MonsterInsights, as you’ll need the Plus version or higher to use the affiliate tracking features. If you’re not sure how to do this, then you can follow our step-by-step guide on how to install and activate a WordPress plugin.

Upon activation, you’ll see a welcome screen. Just click the ‘Launch the Wizard’ button to start the guided setup.

Setting up the MonsterInsights Google Analytics plugin

The wizard will ask you to describe your website: is it a WordPress blog, a small business website, or a shop? 

Select the option that describes your site the best, and then click ‘Save and Continue.’

Installing the MonsterInsights GA plugin for WordPress

Connecting to Google Analytics

Next, we need to connect MonsterInsights to Google Analytics. Go ahead and click the ‘Connect MonsterInsights’ button. 

The MonsterInsights Google Analytics 4 WordPress plugin

On the next screen, select ‘Continue & Connect to Google.’

This will redirect you to Google.

Connecting to Google Analytics using MonsterInsights

You’ll now need to sign into, or select the Google account that manages your Analytics profile.

After that, you’ll have to grant MonsterInsights permission to access your Google Analytics account data. If you’re happy to go ahead, then check the box next to each permission and then click ‘Allow.’

Granting MonsterInsights access to your GA data

Finalizing the Connection

The next step is telling Monsterinsights which website profile to track. Open the dropdown menu and select the Property we created earlier in this article. 

Linking MonsterInsights to your GA Property

Finally, click ‘Complete Connection.’ MonsterInsights will now install the tracking code on your site. 

Once it’s finished, the setup will ask you to confirm some recommended settings and specify which user roles can view GA’s reports. I typically leave this set to ‘Administrator’ but you can change it if you need to.

Controlling access to your analytics reports

When you’re happy to go ahead, click ‘Save and Continue.’

The wizard will now show all the extra features you can enable. After reviewing this information, scroll down and click ‘Continue’ or ‘Skip for Now.’

Linking your WordPress blog, website, or online store to GA

Finally, MonsterInsights will confirm that your setup is complete.

Your site is now connected to Google Analytics, and you’re ready to start tracking your affiliate links. 

The MonsterInsights setup wizard

Viewing Your Affiliate Link Performance

You’ve installed the tracking code, which is great. Now, I want to show you how to actually monitor your affiliate links in WordPress.

A quick note: Google Analytics can take up to 24 hours to process and display new data, so don’t worry if you don’t see results straight away. 

The great thing about MonsterInsights is that you can track affiliate links directly in the WordPress dashboard. To configure this tracking, go to Insights » Settings. Then, click the ‘Publisher’ tab. 

Setting up event tracking on your WordPress website

In the ‘Affiliate Links’ section, you’ll need to enter the URL path you set up in Pretty Links, such as /refer/ or /deals/. 

Under ‘Path,’ type in the exact URL path you’re using. Then, add a ‘Label.’ This will appear in Google Analytics, so make sure it’s something clear and distinctive that you’ll remember.

Adding custom labels to your analytics

If you created multiple URL paths in Pretty Links, then click the ‘Add Another Link Path’ button. 

Then, repeat the same steps for every path you want to track. 

Tracking multiple affiliate paths

You now have one last choice to make, and it affects how the link will appear in your Google Analytics reports. 

You can choose whether the report should show the long, original Target URL (the messy merchant link) or the short, clean Pretty Link URL (the cloaked one using your domain).

I typically choose to display the cloaked, Pretty Link URL in my Google Analytics reports. That’s simply because the clean link is easier to read and understand at a glance, compared to a long string of numbers and symbols. 

This helps me identify the product instantly without having to cross-reference anything. 

How to track cloaked URLs in WordPress

With that done, click the ‘Save Changes’ button to store your settings.

How to View Your Affiliate Link Tracking Report in WordPress

With all that setup out of the way, you can now see your affiliate data directly in your WordPress dashboard, which is incredibly convenient. To take a look, go to Insights » Reports.

Viewing analytics data directly in the WordPress dashboard

Then, click the ‘Publishers’ tab. 

In the dropdown that appears, click on ‘Overview.’

Configuring analytics reports in your WordPress dashboard

Now, just scroll to the ‘Top Affiliate Links’ section to see a clear, straightforward list of all your most-clicked affiliate URLs. 

This dashboard report saves me so much time. I use it for a quick, daily check to see which links are performing well and generating lots of clicks. 

Monitoring your affiliate URLs in WordPress

How to View Your Affiliate Link Tracking Report in Google Analytics

The MonsterInsights dashboard is perfect for monitoring your most popular links. However, you might also need to know the exact page the reader was on, when they clicked each link.

That way, you can identify the specific content pieces that are making you money. For example, you might find that a link placed in the sidebar is converting better than the same link in a long post.

To drill down into that level of detail, you’ll need to go back to Google Analytics and build a custom report, so let’s do that now. 

To get started, log into Google Analytics and click ‘Explore’ in the left-hand menu. 

Creating a custom Google Analytics report

On this screen, you’ll see some templates that can help you build new reports faster, such as Funnel Exploration and Path Exploration. 

However, we’re going to create a custom report, so select the ‘Blank’ template.

Selecting a blank report template

First, you’ll need to give this report a descriptive name.

Under ‘Exploration Name,’ click the field that shows ‘Untitled Exploration’ by default. This makes the field editable. You can now delete this text and replace it with your own, descriptive title. 

Giving your GA report a descriptive name

I usually name my report something clear, like ‘Affiliate Click Performance.’

Defining Dimensions for Affiliate Data

Next, it’s time to add your dimensions. Dimensions are descriptive attributes or a characteristic of your data, such as the type of device used, or whether the user is a first-time visitor. 

To add these dimensions to your report, find the ‘Dimensions’ section and click its ‘+’ sign. 

Adding dimensions to your Google Analytics report

That done, you’ll need to click to expand the ‘Event’ section.

Then, check the box next to ‘Event Name.’ This dimension tells us the type of action that happened.

Building a custom report in Google Analytics 4

Next, click to expand the ‘Link’ section.

Here, check the boxes next to ‘Link text’ and ‘Outbound.’ This tells us the actual, visible text that the user clicked on each page. 

Monitoring external URLs on your WordPress website, blog, or WooCommerce store

Click to expand the ‘Page/screen’ section and select ‘Page title.’

This collects the name of the page where the affiliate link was located, so we can figure out which content is driving the most traffic.

Building a custom analytics report using GA4

After checking all these boxes, click on ‘Confirm.’

GA4 will now go ahead and add all these dimensions to your report.

Building a custom Google Analytics report

Building the Report Table

Now, we need to create our table, so we can see each link and the page it appeared on.

To do this, find ‘Page title’ under the ‘Dimensions’ section. Then, drag and drop it onto the ‘Rows’ section. 

Building a custom table in Google Analytics

Now, you need to do exactly the same thing with ‘Link text.’ That means finding the ‘Link text’ dimension, and then dragging and dropping it onto the ‘Rows’ section.  

This makes each unique link text a separate row in our report. 

Recording clicks in a custom GA report

After that, you need to add a metric showing how many times the click action happened. 

To do this, click the ‘+’ sign next to ‘Metrics.’

How to record link clicks in Google Analytics

In the panel that appears, click to expand the ‘Event’ section.

Then, check the box next to ‘Event Count.’

Counting clicks in the Google Analytics 4 dashboard

With that done, click ‘Confirm.’ 

This will add ‘Event Count’ to the ‘Metrics’ section. 

Counting link click metrics in WordPress

Now, drag and drop ‘Event Count’ onto the ‘Values’ section. 

Placing it here tells the report to display the total number of clicks for each combination of link text and page title.

An example of a Google Analytics 4 dashboard

Filtering the Report for Clicks Only

Now comes the important part: you need to tell the report to ignore everything apart from the affiliate clicks. 

To do this, drag the ‘Event name’ to the ‘Filters’ section. 

Filtering events in your GA4 dashboard

You can now choose ‘exactly matches’ from the dropdown. 

In the box, type ‘click’ in lowercase and then click ‘Apply.’ This tells Google to only include data where the user specifically clicked on something. 

The Google Analytics dashboard

With that done, drag ‘Outbound’ to the ‘Filters’ section.

Once again, open the dropdown menu and select ‘Exactly matches.’

Filtering outbound links in Google Analytics 4

Then, type in ‘true.’

Finally, click ‘Apply.’ This tells Google to only include links that are specifically leaving your site. 

Creating custom filters for your analytics report

That’s it! You’ve successfully built a custom report that shows which pages generated clicks on your affiliate links.

Just keep in mind that the report is tracking clicks, which doesn’t necessarily mean the visitor actually went ahead and made a purchase.

How to Set Up WooCommerce Affiliate Link Tracking

WooCommerce supports affiliate products, meaning that the customer checks out on another site rather than your own. 

If your online store features external products, then MonsterInsights is smart enough to track these links automatically, which is a huge time-saver. Since MonsterInsights hooks directly into the core WooCommerce settings, you don’t need to do any extra cloaking or manual setup for these specific product links.

To create an affiliate product in WooCommerce, go to Products » Add new product in your WordPress dashboard. You can then create the WooCommerce product as normal by adding things like a product name, a compelling description, and a product image. 

How to add affiliate products to your online store

When you’re happy with the information you’ve entered, scroll to the ‘Product data’ box.

Here, open the ‘Product data’ dropdown and choose  ‘External/Affiliate product.’ This is the critical step because it’ll trigger MonsterInsight’s affiliate tracking features.

How to add affiliate products to your WooCommerce store

You can now enter the affiliate URL into the ‘Product URL’ field, and type in the call-to-action you want to display, such as ‘Visit Our Partner Site.’

Even though the sale happens externally, you can add the pricing information to help the customer decide whether this product is right for them. 

How to track affiliate products on your WooCommerce store

With that done, go ahead and publish the product as normal. MonsterInsights will now automatically track clicks on that button as affiliate clicks.

To see which affiliate products are performing the best, just go to Insights » Reports » Publishers in your WordPress dashboard. 

All your affiliate products are automatically included in the ‘Top Affiliate Links’ report. I check this report often because it quickly shows me which store listings are driving the most traffic to my partners.

Now you’ve set up your tracking system, you may need some extra help to tackle other essential tasks like installing themes or setting up a contact form.

In that case, you can check out our video tutorials. They walk you through everything, from the essential setup like installing plugins and creating pages, right through to the more advanced ways you can customize your site.

By mastering these essentials, you can continue to grow your site and boost your affiliate income.

Sign Up For WP101 »

Filed Under: Blog Tagged With: MonsterInsights

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search this Site

See our handpicked list of the best WordPress plugins and themes for your site!

We've done the hard work for you! Check out our list of the best WordPress plugins, themes, and services to get the most out of your WordPress website.

Products We ♥

Most Popular Articles

  • How to Install WordPress in 5 Minutes
  • Why Do We Recommend Managed WordPress Hosting?
  • Best WordPress Hosting in 2026. Which One is Right for You?
  • How to Use the WordPress 101 Videos to Train Your Clients
  • 10 Reasons Why You Should Never Host Your Own Videos

Most Recent Articles

  • I Tested the Best One Page WordPress Themes (Here’s My Top 9)
  • How to Create a Yes/No Optin for Your WordPress Site
  • 9 Best WordPress Conversion Tools (Skyrocket Sales & Signups)
  • How to Track Affiliate Links in WordPress (Full GA4 Guide)
  • I Tested 9 Lightweight WordPress Themes (Which is the Fastest?)

Chat with a WordPress expert?

Need a quick fix or minor tweak to your WordPress theme? Or a custom feature for your site? Chat with a WordPress expert!

Chat Now

Connect with us!

  • Email
  • Facebook
  • Twitter

Site Links

  • About Us
  • Your Account
  • Products We ❤️
  • Affiliates
  • Testimonials
  • Blog
  • Contact Us

Courses

  • WordPress 101
  • WooCommerce
  • Elementor
  • Spectra
  • WPForms
  • Ninja Forms
  • View All →

Products

  • WP101.com
  • WP101 Plugin
  • Embed our videos on your site!

Recent Posts

  • I Tested the Best One Page WordPress Themes (Here’s My Top 9)
  • How to Create a Yes/No Optin for Your WordPress Site
  • 9 Best WordPress Conversion Tools (Skyrocket Sales & Signups)
  • How to Track Affiliate Links in WordPress (Full GA4 Guide)
  • I Tested 9 Lightweight WordPress Themes (Which is the Fastest?)

Connect with Us

  • Email
  • Facebook
  • Twitter

WordPress Tutorials by WP101© 2008-2025 WP101® LLC. All rights reserved.
WP101® is a registered trademark with the U.S. Patent and Trademark Office.
WP101® is hosted by SiteGround.
Privacy Policy | Terms of Use | Disclosure | WP101 Coupon