How To Build A Referral Marketing Tool On WordPress

One day, my client asked me to look for a referral marketing software for a campaign. Specifically, tool that lets you unlock bonuses whenever a person refers 3 friends to sign up.

I looked high and low for a simple solution but there wasn’t one.

So I decided to build one myself.

After a bit of tinkering, I came up with an MVP. Here’s how you can do the same:

Planning Stage

One thing I learned at my time working at NEXT Academy was the concept of pseudocode. Code can be used to solve complex logical problems. But before you embark on building your solution, you should always try to map out, step-by-step how your solution works in layman terms.

For this project, although I won’t be doing much coding, the same concept applies. I’ll be writing down a series of steps of how I plan to build my referral marketing tool.

Here are the steps:

  1. Person who refers others (known as ‘Referrer’) signs up to get his own referral link
  2. He gets his referral link upon signing up and is saved in a database (Google Sheet)
  3. He can then use his referral link to invite others.
  4. When others sign up, they are saved in the database as well. They also get their own referral link to bring in others.
  5. The cycle repeats itself.
  6. In the database, I need to be able to see Referrers and how many they refer.

Okay, now that I have all the steps, I can try and build my solution.

Tools Needed

I’ll first need a sign up form that can put people directly in a Google Sheet.

You have a few options here:

Option 1 (Easy) – Use Fluent Form Pro WordPress plugin. (note: has my affiliate link. Click here for non-affiliate link). 

Option 2 (Medium): Use Elementor Pro (again, for non affiliate link use this) and connect Google Sheet with Zapier.

Option 3 (Hard, but free): You need to code your own HTML form which sends the data to a Google Sheet. You also need to use a Google Sheets script which can accept the data from the HTML form. Full tutorial here.

I went for Option 1 as I already have a Fluent Form account and I don’t want to pay Zapier every month for zaps.

Integrating Fluent Forms Pro with Google Sheets is super easy, just follow the instructions here.

And of course, we will need a Google Sheet where the data will be stored whenever someone signs up (and to integrate with Fluent Forms Pro). Go ahead and make one. That’s all we need for tools.

Building The Steps

Let’s look at the steps again:

  1. Person who refers others (known as ‘Referrer’) signs up to get his own referral link
  2. He gets his referral link upon signing up and is saved in a database (Google Sheet)
  3. He can then use his referral link to invite others.
  4. When others sign up, they are saved in the database as well. They also get their own referral link to bring in others.
  5. The cycle repeats itself.
  6. In the database, I need to be able to see Referrers and how many they refer.

Step 1

My plan for (1) is to make sure after the Referrer signs up, he goes to a “Thank you” page. The Thank you page should also have data about his firstname somewhere. In this case, I made sure the data about the firstname is visible on the url on the “Thank you” page. Fluent form allows you to do that easily by ‘passing’ the form field data into the url of the thank you page.

Step 2

Here’s where it gets fun. With his firstname on the thank you page, I’ll generate a referral link by attaching his first name to the page we want to share.

His referral link will basically be a link to the first page with his first name as the unique identifier.

Example: www.growthpj.com/landing-page?ref=khai

Here I just need some Javascript magic to join the url parameter (e.g ?ref=khai) to a string which is the url of the page we want to share.

www.growthpj.com/landing-page + ?ref=khai (obtained from the url)

Boom! You got your referral link.

 

Step 3

Optional: If you want to take things up a notch, you can create an input field which contains the affiliate you’ve just generated so it’s easy for them to copy and share with their friends.

 

Final Step

For all this to work, you need to collect 3 fields in your Google Sheet.

  1. First Name
  2. Email
  3. Referrer (First Name Of Referrer) 
Hence, whenever the first name of a referrer appears at least 3 times, you know you can unlock the reward for that person!

See It In Action