WordPress Expert and Web Apps Engineer

Creating an Affiliate Link Cloaker with Kinsta

What an affiliate link cloaker is - and how to add such functionality (without plugins!) to a WordPress Web site hosted on Kinsta.
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on reddit
Reddit

DisclosureLinks in this article may be affiliate links to which I earn revenue upon purchase of a product or serviceAll of my reviews are based upon our own unbiased experience with a product or service.

Affiliate programs remain a great way to make money with your content. One of the more popular techniques people use when linking out to affiliates is an affiliate link cloaker. There are various ways to implement link cloaking on WordPress. And if you host your WordPress installation through Kinsta, there’s a very easy way to set up cloaked links.

The link for this banner is a cloaked affiliate link implemented with Kinsta!

What is an Affiliate Link Cloaker?

Companies generally assign their affiliates some sort of numeric ID, which affiliates must the embed in all URLs they use. The affiliate ID is how the company tracks the traffic you send. When a reader who came in via a link with your affiliate ID attached makes a purchase, you get a portion of that purchase.

Unfortunately, this means that affiliate links are generally nasty-looking constructs. They tend to look something like:

https://awesomecompany.com/?aff_id=0192ab49fedb42ca1275

A reader who hovers over such a link is bound to be turned off. The majority of the link appears to be a jumble of nonsense. It doesn’t tell you what the link is really about or why the reader should click it.

Enter link cloaking. An affiliate link cloaker uses HTTP redirects to wrap an affiliate link in a pretty package. Instead of pointing your readers at the gobbledygook above, for example, you can create a pretty URL on your own site that makes the intent of the link clear. For example, my affiliate link to Kinsta is:

https://jayandrewallen.me/recommends/web-hosting

The first word in the path of the URL helps me gather all of my affiliate links in a single location for report filtering purposes. (You don’t have to use “recommends”; you could also use “ref”, “refer”, “affiliate”, “aff”, or whatever path you prefer.) The second word makes it clear what I’m recommending.

Benefits of an Affiliate Link Cloaker

An affiliate link cloker has benefits beyond providing pretty URLs for your users. They also help you manage your affiliate programs better.

One of the benefits of using an affiliate link cloaker is that you can capture more data. Specifically, you can see in your Google Analytics reports how many people are clicking on affiliate links – and which links they’re clicking. This is very beneficial, especially when your affiliates are spread across multiple affiliate management systems. MonsterInsights, the popular WordPress package for Google Analytics, provides built-in support for this style of reporting.

Another benefit is abstraction. What happens if the format of the affiliate link changes at some point? What if you want the freedom to switch out the affiliates you use for certain programs down the road? Using an affiliate link cloaker makes switching out affiliates URLs much easier.

Using Kinsta Redirects for Cloaking

There are different ways to implement an affiliate link cloaker. In the MonsterInsights article I pointed to above, they recommend a WordPress plugin, Pretty Links.

However, it’s always a good idea to minimize the use of plugins when you can. Yes, the notion that you shouldn’t “use too many plugins” is incomplete advice at best. But why resort to a plugin if the managed WordPress host you’re using provides the same functionality for you?

Kinsta has a lot of great native tools that render installing additional plugins in WordPress obsolete. One of those is its Redirects tool. From the Kinsta dashboard for your site, you can create simple redirect rules easily. You can also craft more complex redirect rules using regular expressions.

To create an affiliate link shortcut, go to your site in your Kinsta dashboard and select Redirects from the left hand navigation panel. Then select Add redirect rule. Create your redirect rule as a 302 (Temporary) redirect.

In this example, once we click Add redirect rule, we’ll be able to use the URL https://mysite.com/recommends/keyword-finder as a shortcut for this affiliate relationship.

Note that another benefit of an affiliate link cloaker is that it creates URLs that are easy to remember. In the past, if I wanted to add this affiliate link into a post, I would have to look up my affiliate code. Since I now have a cloaked URL, I can simply type it out from memory as I’m writing my post. Easy!

You Still Need to Disclose!

One word of warning. Those of us doing business in the United States are required by law to disclose when we are referring a reader to an affiliate. We must be clear that we have a business relationship with the affiliate and will receive a commission if the reader makes a purchase. Link cloaking doesn’t change this requirement! In fact, not disclosing the nature of a cloaked link might open you up to charges that you’re intentionally hiding your affiliate relationship.

Should You Cloak Every Link?

Most affiliate programs let you attach your affiliate ID to any link on the Web site. This allows you to point to useful How Tos and updates from the affiliate sponsor themselves and still get a commission if a reader makes a purchase. However, it raises another question: Should I cloak every link to a site of which I’m an affiliate?

My own gut instinct is not to cloak every link. If you’re deep-linking into a site, the URL the user sees will be longer and more descriptive. The affiliate code will be less of a distraction. Cloaking every single URL is additional work. Plus, it reduces the number of outbound links your post has, which could hurt SEO.

Give it a try for yourself. And if you’re not using Kinsta yet, check them out!

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on reddit
Reddit

Contact Me

To get started with a discussion of your needs and a list of prices, please contact me today. I’ll be in touch with you within the next 24 business hours.