Add a subscriber
There are multiple ways to add subscribers to ReferralHero and generate referral links. Below, we walk through two methods using our JavaScript Web API to add subscribers. You might want to use one of these functions if you prefer:
Web Signup Form:
Integrate the
add subscriberfunction into your own web signup form. This allows you to add subscribers or identify them at the time of form submission.This method is ideal for custom signup forms where you want to control the user experience and capture subscriber information seamlessly.
Web Login Page:
Incorporate the
add subscriberfunction into your web login page to add or identify subscribers during the login process.This approach is useful if you want to track users as they log in while also adding them to your referral program automatically.
Adding a Subscriber (Referred or Non-Referred)
RH_MFxxxxxxxxxx.form.submit(uniqueIdentifier);When adding a subscriber to your ReferralHero campaign, you can track different conversion events based on your campaign goals. This guide explains how to add both referred and non-referred subscribers.
Using the RH_MFxxxxxxxxxx.form.submit() Function
To add a subscriber according to the above logic, use the RH_MFxxxxxxxxxx.form.submit() function and pass the user information such as email address, name, etc.
Here's an example of how to implement this in your form:
If a referral link is not used, the system will create a non-referred subscriber. If a referral link is used, the system will evaluate the conversion events and create or update the referral accordingly.
For a campaign with one conversion event, a referral will be created and set to Confirmed upon completion of the event.
Subscriber 1 (without referral code) , subscriber 2 (used subscriber 1's referral code)

For campaigns with two or three conversion events, a referral will be created and set to Pending until the additional events are completed.
Subscriber 1 (without referral code) , subscriber 2 (used subscriber 1's referral code)

Example: Add a Subscriber (Custom Unique Identifier - Crypto Wallet Address)
If you are utilizing the ReferralHero Blockchain integration, you must also include the #crypto_wallet_provider in your data. To add a subscriber using their crypto wallet address, use the RH_MFxxxxxxxxxx.form.submit() function. This approach is especially useful when integrating with a custom 'wallet connect' system, enabling efficient management and tracking of participants based on their wallet information.
By providing both the wallet address and provider details, you can seamlessly integrate and track subscribers within your referral program.
Running Multiple Campaigns
Imagine you are running an e-commerce platform and need to direct new customers and returning customers to different referral campaigns. Follow these steps to set up your ReferralHero integration:
Install the Global Tracking Script Ensure that the ReferralHero Global Tracking Script is added to the
<header>section of your website. This will enable tracking across all pages.Define Campaigns Identify the campaign UUIDs for new customers and returning customers.
Submit Subscriber Information
For New Customers: Use the following function to add new customers to the specified campaign:
Copy
For Returning Customers: Use this function to track returning customers and ensure they are placed in the appropriate campaign:
Copy
Note: Replace
MFxxxxxxxxxxwith your actual campaign UUIDs.
Last updated
Was this helpful?