Referral programs are everywhere. Just about any time you sign up for a new SaaS product or subscribe to a hot new email newsletter, you’re given a referral link you can share with others for a special bonus.

Creating a referral program is an incredible way to get social proof for your product. Someone signs up, other people see them doing so, and in turn they’re more likely to sign up as well.

“[Social proof] describes a psychological and social phenomenon wherein people copy the actions of others in an attempt to undertake behavior in a given situation.”

While working on my most recent product,  Shelf (check it out!), I implemented a custom referral program, and wanted to share how I did it.

The Plan

For this project, I’m going to use a Node.js/Expressjs server and a MySQL database. You’re free to use any web server + database combo, as the same principles will apply.

The Node server will need to do the following:

  • Render a web page with an email sign-up
  • Generate unique referral codes for each user who signs up
  • Return the referral codes to the client so they can be displayed

…and the database needs to hold a list of everyone who has signed up, with the following info:

  • Email address
  • Referral code (their unique code)
  • Referrer (the code they used to sign up with, if any)
  • Time added

Originally published at https://medium.com

#referral-marketing #mysql #nodejs #javascript

How to Build a Simple Referral System with Node.js and MySQL
42.20 GEEK