Embed the Viral Referral Page on my Site

If you would like to host the Referral Page on your own site — for example, to redirect to a thank you page on your own site after the Signup Form is submitted or to encourage viral referrals elsewhere within your application — then you can do so by following these instructions. 

Option 1: Use the Embeddable Widget

1

Ensure the Prefinery JavaScript snippet is installed on your thank you page.

2

Copy and paste the following code onto your web page where you want the referral page to appear:

<div class="prefinery-viral-referral-embed" data-prefinery-tester-id="123"></div>

3

Set the value of data-prefinery-tester-id to the user's unique id.

Note: If you set the value of data-prefinery-tester-id attribute to an empty string, then we will automatically personalize the referral page based on the value of the "ref" URL parameter, representing the ID of a particular user in your campaign. For this to occur, you need to enable the Include User ID in URL setting when redirecting to your own thank you page, as described below.

4

Optionally, to automatically personalize the referral page based on the value of the " ref" URL parameter included when redirecting from the signup form, set the data-prefinery-tester-id attribute to an empty string.

<div class="prefinery-viral-referral-embed" data-prefinery-tester-id=""></div>

Additional Configuration Settings

Here is a complete reference of all settings you can pass to the referral page embeddable widget. Just add any of these as data attributes to the  prefinery-viral-referral-embed div.

Attribute Value Description
data-prefinery-tester-id integer (e.g. 100456) Lookup the user's referral page by their id.
data-prefinery-tester-email string (e.g. "user@host.com") Lookup the user's referral page by email address.

Option 2: Use the JavaScript Web API

1

Ensure the Prefinery JavaScript snippet is installed on your thank you page.

2

Place an empty div on your web page where you want the referral page to appear:

<div id="referral-page-embed"></div>

3

Call the JavaScript Web API to embed the referral page inside the div.

prefinery('embedReferralPage', {
  email: 'bruce@wayneenterprises.com',
  dom_id: 'referral-page-embed',
});

You can look up the user by email, referral_code, or id. For details, see the JavaScript Web API documentation.

Note: In order to automatically look up the user by their ID when redirecting from the signup form, make the above call and only set the dom_id value. Do not set any email, referral_code, or id value. When no user is specified, Prefinery will automatically personalize the Referral Page based on the value of the "ref" URL parameter, representing the ID of a particular user in your campaign. For this to occur, you need to enable the Include User ID in URL setting when redirecting to your own thank you page, as described below.

4

Optionally, to automatically personalize the referral page based on the value of the " ref" URL parameter included when redirecting from the signup form, use the following code:

prefinery('embedReferralPage', {dom_id: 'referral-page-embed'});

Redirect to your own thank you page when the Signup Form is submitted

You can configure the Signup Form to redirect to your own thank you page after the form is submitted. 

If you're redirecting to this page from another integration (your own non-Prefinery form, Zapier, etc.) then just make sure that the user's ID or email address is passed in as a URL parameter so that you can read the value and set either the `data-prefinery-tester-id` or `data-prefinery-tester-email` attribute as described above. You or your developer should be able to help set this up.

  1. Click on the Signup Form link in the left-hand sidebar then navigate to the Settings tab.
  2. Change the answer to "After the form is submitted, what do you want to do?" to "Redirect to a URL".
  3. Enter the URL to the thank you page on your site (e.g. https://yourdomain.com/thank-you).
  4. Enable the option to include the user ID in the the redirect URL.

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