How to Track Affiliate Links in WordPress (Using Google Analytics)

Forrest Pykes Jul 6, 2025

Want to learn how to track affiliate links in Google Analytics?

By tracking your affiliate links, you can see exactly how users interact with them on your website. With this data, you can optimize your links to increase conversions and revenue.

In this step by step tutorial, we will show you how to track affiliate links in WordPress in just 3 easy steps.

We’re going to use Google Analytics and a WordPress plugin to do this. So first, we need to explain why tracking affiliate links is so important so that you understand why we chose this approach.

Why Track Affiliate Links?

Affiliate marketing is undoubtedly one of the most popular ways to make money online. If you have a WordPress site that has a lot of regular traffic, then you can make a decent income by adding affiliate links on your site.

These links will redirect users to the sales page of the vendor’s product with your affiliate ID attached. So when a user buys the product through that link, you will get a certain amount of commission.

You can add links randomly and hope to make money, but if you want to be successful in affiliate marketing and earn high income from it, then you need proper affiliate link management and organization.

Let’s be honest, affiliate marketing cannot be successful without proper data and analytics.

You need to know actual statistics on how your referrals interact with your affiliate links. This will help you optimize your marketing strategy and place your links strategically to maximize your earnings.

Without this data, you’re losing a lot of revenue.

That’s why it’s so important to track your affiliate links. By tracking this data, you can do the following:

  • Get actual data on user interactions: You can see exactly how referrers interact with your affiliate links. Analyze where users click the most.
  • Identify the most profitable links: Focus on those links that bring the most conversions.
  • View your highest converting pages: See which pages bring in the most affiliate sales and optimize them to earn more revenue.

All in all, affiliate tracking helps you understand how referrals view and interact with your affiliate links. It provides comprehensive data to help you optimize your affiliate marketing campaigns and maximize revenue.

Step 1: Install and Activate MonsterInsights

The first thing you need to do is install MonsterInsights on your WordPress site .

How to Track Affiliate Links in WordPress (Using Google Analytics)

MonsterInsights is the best Google Analytics plugin because it’s so easy to set up.

In fact, you don’t even need to import a Google Analytics activation code or use the Google Analytics API to connect to MonsterInsights; it does everything for you.

It’s the best way to see site metrics on your WordPress site in real time without having to juggle multiple dashboards. It also simplifies complex data in GA4 in an easy-to-understand way.

While there are many GA-4 plugins available, we used MonsterInsights for this tutorial because it comes with many affiliate program features built-in. It makes it very easy to set up affiliate link tracking without any technical difficulties.

That being said, first, head over to the MonsterInsights official website and choose a plan. Here, make sure you purchase the MonsterInsights Plus plan or higher.

Of course, MonsterInsights offers a free version of the plugin that can help small businesses and bloggers scale up. However, the affiliate link tracking feature is only available in the Plus plan, which starts at $99.60 per year.

After that, download the MonsterInsights plugin and copy the license key; you will need it to activate the pro version.

How to Track Affiliate Links in WordPress (Using Google Analytics)

Now, go to your WordPress dashboard and upload the plugin ZIP file to WordPress like any other plugin.

To do that, simply navigate to Plugins » Add New » Upload Plugin . Then click Install Now and finally Activate the plugin.

Then, go to Insights » Settings and open the General tab. Here, paste the license key you copied earlier and click Verify.

How to Track Affiliate Links in WordPress (Using Google Analytics)

That’s it! You have successfully installed and activated MonsterInsights.

If you have any questions, here’s an article on how to install a WordPress plugin .

Step 2: Connect Google Analytics with Monster Insights

If you already have a Google Analytics account, the next step is to connect MonsterInsights to it through the setup wizard. If you don't have a Google Analytics account, don't worry; signing up is easy.

If you are worried about the cost of Google Analytics, rest assured that it is completely free and you can use all its features without paying anything.

Simply go to the Google Analytics website and click “Get Started Now” to create your account.

How to Track Affiliate Links in WordPress (Using Google Analytics)

Once you have done this, Google Analytics will provide a step-by-step process for creating an account.

You should now have your MonsterInsights account and GA-4 dashboard ready to go.

The next step is to navigate to Insights » Settings » General in your WordPress dashboard and scroll down to select “Launch Setup Wizard”.

How to Track Affiliate Links in WordPress (Using Google Analytics)

The MonsterInsights setup wizard is designed to simplify the initial setup process and ensure that you follow all the steps. As a result, you will enjoy a quick setup process and connect MonsterInsights to Google Analytics in just a few minutes.

Now, on the first page of the setup wizard, specify the type of site you are running. Then on the next page select “Connect MonsterInsights”.

This will bring up a window showing all of the Google Accounts on your computer.

In the list, select the Gmail account linked to your Google Analytics account, then select Allow to grant MonsterInsights access to your Google account.

How to Track Affiliate Links in WordPress (Using Google Analytics)

Finally, on the last page of the MonsterInsights setup wizard, use the checkboxes to indicate the metrics you want to track.

How to Track Affiliate Links in WordPress (Using Google Analytics)

Once you have made your selections, click Continue to complete the setup.

Once the connection is created, MonsterInsights will automatically start tracking your WordPress website data through Google Analytics.

Step 3: Hide your affiliate links using Pretty Links

Now, it is crucial to hide your URLs in order to ensure accurate tracking of clicks from outbound affiliate links using MonsterInsights. This will help you maintain clean and easy-to-use URLs and increase the efficiency of tracking affiliate activity on your website.

In this tutorial, we used Pretty Links .

How to Track Affiliate Links in WordPress (Using Google Analytics)

Pretty Links is the best affiliate link cloaking plugin. This free plugin allows you to shorten and manage outbound links right from your WordPress dashboard.

It allows you to customize your affiliate links as needed and even include your domain name in the URL. This improves the overall appearance of your links and builds trust with your audience.

The free Pretty Links plan provides everything you need to get started with affiliate link cloaking. However, advanced features like in-depth click tracking reports are only available in the Pro plan.

If you want to purchase the premium version of this plugin , check out this page.

Other than that, setting up Pretty Links is super easy! Just go to your WordPress dashboard, select “Plugins” , then “Add New” . Then type “Pretty Links” into the search bar and click “Install Now”.

Once installed, you can access the plugin’s features from your WordPress dashboard by selecting the new menu option “Pretty Links”.

Next, click ‘Add New’ on the next page to add your affiliate link to Pretty Links.

How to Track Affiliate Links in WordPress (Using Google Analytics)

Now, it's time to configure your links!

In order for MonsterInsights to accurately track your affiliate links, you must redirect your original, longer affiliate link to a URL on the same path.

We'll show you how to do this with the demonstration below.

If your website is mysite.com and you are promoting MonsterInsights through Shareasale, your affiliate link to MonsterInsights will look something like this:

http://www.shareasale.com/r.cfm?B=940284&U=3982035&M=1982305&urllink=

With Pretty Links, you have the flexibility to customize this long link into a user-friendly, SEO-optimized, and branded URL.

For example, you could create a new URL like mysite.com/affiliate/tool.

Now, users will see and interact with the personalized URL while being seamlessly redirected to your original Shareasale affiliate link.

mysite.com/affiliate/monsterinsights

Now, as mentioned above, you need to ensure consistency in your link path structure.

In the example above, we used /affiliate/ followed by the product name. You can use any path you prefer, such as /refer/tool or /go/product.

But ultimately, you need to use the same path for all of your affiliate links.

If you’re looking for an alternative to Pretty Links, you can check out ThirstyAffiliates .

Step 3: Set up tracking in MonsterInsights

Now that your affiliate URL is cloaked and ready for tracking, it’s time to configure your tracking settings in MonsterInsights.

To do this, go to Insights » Settings » Publishers in your WordPress dashboard. This will take you to the MonsterInsights feature.**

Then, in Publisher Settings , scroll down and find the Affiliate Links section.

Here, enter the URL path you want to use for your cloaked affiliate links (e.g., /affiliate/) and assign it an easy-to-remember label.

How to Track Affiliate Links in WordPress (Using Google Analytics)

This tag will appear in Google Analytics when you want to analyze your affiliate links.

MonsterInsights allows you to add multiple paths. So, all you need to do is select “Add another link path” and repeat the above steps.

Once you are finished, save your changes.

Finally, you’ll use the checkboxes to decide how MonsterInsights uses Pretty Links URLs.

How to Track Affiliate Links in WordPress (Using Google Analytics)

That’s it! You can now track your affiliate links using MonsterInsights.

Step 4: View your tracking report

Now that you have affiliate link tracking set up, you can easily view the metrics on your WordPress dashboard using MonsterInsights.

To access your affiliate link tracking report, go to Insights » Reports » Publishers in your WordPress dashboard . Then scroll down to find “Top Affiliate Links.”

Here you’ll find valuable insights into your top-performing affiliate links, including the total number of link clicks.

How to Track Affiliate Links in WordPress (Using Google Analytics)

If you want to see more detailed data, click the “View All Affiliate Links Report” button at the bottom of the report. This will redirect you to the affiliate link data in your GA 4 dashboard.

But you can also view full reporting of your affiliate links in Google Analytics 4.

You can get information such as the page that the visitor was on when they clicked the link.

To do this, go to the Explore tab in Google Analytics and create a blank report to start from scratch.

How to Track Affiliate Links in WordPress (Using Google Analytics)

You will then search for the following dimensions and import them into your report.

  • Activity Name
  • Is an affiliate link
  • Page Title
  • Affiliate Label
  • Link text

Once these dimensions have been imported, go to the Metrics box and add the Event Count metric by selecting the plus sign (+). Now arrange the dimensions and metrics in your reports to ensure consistency in event tracking.

Drag and drop Page Title, Affiliate Label, and Link Text from the Size box to the Rows section.

How to Track Affiliate Links in WordPress (Using Google Analytics)

After this, move Event Count from the Metrics box to the Values section.

How to Track Affiliate Links in WordPress (Using Google Analytics)

Now, to ensure the accuracy of your reports, it is crucial to apply appropriate filters.

First, select the “Is Affiliate Link” dimension from the “Dimensions” box and drag it to the “Filters” section. Then, select “Exact Match” and set it to “True.”

After that, click on “Apply”.

How to Track Affiliate Links in WordPress (Using Google Analytics)

Finally, drag the Event Name dimension from the Dimensions box to the Filters section and select Exact Match.

Then select Apply to activate the filter.

How to Track Affiliate Links in WordPress (Using Google Analytics)

Congratulations, you can now build custom reports in GA-4 that will show you which affiliate links were clicked, what pages they were on, and how many times they were clicked!

FAQ: How to track affiliate links in WordPress

What are Metrics in Google Analytics?

Metrics in Google Analytics help you understand how users interact with your website. Expressed as numbers, percentages, or currencies, these metrics can help you gain insight into various aspects of your website's performance, such as traffic, engagement, conversions, demographics, and more.

What is the difference between Google Search Console and Google Analytics?

Google Search Console focuses on how your site appears in search engine results pages (SERPs) and helps you optimize your site for search visibility. It provides data on keywords users use to find your site, crawl errors, and mobile device usability. Google Analytics focuses on how visitors interact with your site once they arrive. It provides data on traffic sources, user behavior, conversion rates, and more. Both are free Google tools.

How to Find Bounce Rate in Google Analytics 4?

Your best bet is to download MonsterInsights so you can automatically find your bounce rate in your reports. Of course, you can also use Google Analytics 4. You can view your bounce rate by navigating to the Reports section in your Google Analytics 4 property. Then select Engagement in the left menu. After that, under Engagement select Overview. You’ll find your bounce rate displayed alongside other engagement metrics like average engagement time and sessions per user. You can also just use the GA-4 search bar and type in “bounce rate” and it should appear in the search results.

What data can't be tracked by Google Analytics Goals?

Google Analytics Goals cannot track offline events, such as phone calls or in-store purchases, unless integrated with other tools or platforms. It also cannot track qualitative data. It focuses on quantitative data (numbers) and cannot capture user emotions, opinions, or motivations.

What are Goals in Google Analytics?

Goal goals track when a user arrives at a specific page URL on your site. Event goals track specific interactions a user has on your site, not just page views. Duration goals track a specific amount of time a user spends on a specific page or set of pages. Pages per Session goals track the number of pages a user views in a single session.

At this point, you’ve learned how to track affiliate links in WordPress. MonsterInsights is just one of the plugins you need as an affiliate marketer. You may want to check out our guide: 15+ Affiliate Marketing Tools Every Marketer Needs (2025) .

These marketing plugins will help you use coupons, popups, automation, landing pages, social media, and add more features.

We hope this article helps, if so, you might also want to check out our guides on:

The first guide is a review of AffiliateWP, one of the best affiliate program plugins. The next one will help you set up click tracking to see which affiliate outbound links/buttons get higher engagement. The last one will help you track eCommerce products on your website.

We also have this helpful guide for you: Affiliate Marketing Made Easy for Beginners: Step by Step .

Disclosure: Some of the links in this article contain affiliate links, which means we may earn a commission if you click through to visit us, at no extra cost to you. See how SidelinePlay is funded, why it’s important, and how you can support us.

Was this helpful?

0/400

Get free tips and resources right in your inbox, along with 60,000+ others