What Triggers a Referral?

When a person follows a friend's unique referral link and lands on your website, a Share will be recorded and attributed to the owner of the referral link. A Referral is triggered if the person subsequently signs up.

How do I record a Sign Up event?

There are various ways to record a Sign Up in Prefinery:

1. Embedded Signup Form

When using Prefinery's embedded Signup Form a referral will be recorded automatically if the form is submitted after a person follow's a friend's unique referral link. There is nothing you need to do to configure this behavior. We use cookies so that the referral is tracked even if the person submits your form days or weeks later.

2. Raw HTML Form

If you choose to build and design your own HTML form and submit signups to Prefinery via your project's unique action URL, then you will need to manually attribute the referral. To do this, set the "referral_token" input field with the value of the referral code of the user to whom you want to credit the referral.

<form action="YOUR-UNIQUE-PROJECT-ACTION-URL" class="pfy-signup-form" method="post">
  <input id="referral_token" name="referral_token" type="hidden" value="SET-THIS-VALUE">
  <input autocomplete="email" type="email" name="user[profile][email]">
  <input type="submit" value="Submit">
</form>

3. API

When using Prefinery's API, you will need to manually attribute the referral. To do this, set the "referrer_id" parameter when creating the new user via the Testers#create endpoint.

How do I keep track of the referring user's unique referral code?

When using Prefinery's embedded signup form, you do not need to keep track of the referring user's unique referral code. As mentioned above, a referral will automatically be recorded when the Signup Form is submitted.

However, when using your own HTML form, or our API, you will need to keep track of the referring user's unique referral code. For example, let's say that Mark is referring Mary to your website. Mark's unique referral link is https://yoursite.com/?ref=abcde. He shares that link with Mary, who clicks it, and lands on your website. You need to know that she was referred by "abcde" in order to properly credit Mark with a referral.

Prefinery's JavaScript snippet automatically records this referral code in a cookie, which your site can access. The cookie is named in the format "_pfy_{your-project-id}_referral". For example, if your Project ID (found inside your Prefinery account by clicking on the Settings menu and then Project Settings) is "4z9l85sf" then the cookie will be named "_pfy_4z9l85sf_referral" and the value will be the referring user's unique referral code (in this example, abcde).

Still need help? How can we help? How can we help?