Home » FundThrough for Partners » Overview » Referral Button
A Referral Button is a button you can drop in your experience with a few lines of code to link to a Referral Page, while passing along additional information to kick-start the onboarding process.
Technical Skill Required
Low. Simply copy and paste the JavaScript below to get the standard button working. More effort is required to populate the variables with information about your customer.
Once a Referral Page has been implemented, the basic steps are:
Then optionally:
Include the JavaScript library on the page:
Add the button and assign it the following class:
Enable the button:
FTPayMeNow.enableReferralButton();
That will give you a basic button.
Provide data via the button by adding data parameters.
The minimum required: name, last-name, email and phone
If you implemented your own Referral Page, and you have a contact form on it, you can modify the page to populate the form with the data provided.
document.addEventListener('DOMContentLoaded',() => {
var params = new URLSearchParams(window.location.search);
if (params.get("user_data") !== null) {
userData = JSON.parse(atob(params.get("user_data")));
// Pre-populate form fields with provided data
document.getElementById("form-field-given_name").value = userData.name;
document.getElementById("form-field-last_name").value = userData.last_name;
document.getElementById("form-field-company_name").value = userData.company_name;
document.getElementById("form-field-email").value = userData.email;
document.getElementById("form-field-phone").value = userData.phone;
}
}
If you implemented your own Referral Page, and you don’t have a form, you can simply pass along the provided data to FundThrough’s onboarding:
var form = document.getElementById('SIGNUPFORMID');
form.addEventListener('submit', handleRedirect);
function handleRedirect(el) {
var params = new URLSearchParams(window.location.search);
window.location.replace('https://invoices.fundthrough.com/signup?user_data=${params.get("user_data")}&partner=PARTNERNAME');
}
Interested in possibly embedding FundThrough in your platform? Let’s connect!