Add a Pending Referral

RH.pendingReferral(uniqueIdentifier);

This function is used to track referrals that enter the first step of a multi-step conversion event .

GOAL: Two or Three Conversion Events

Your campaign Goal must be set up to track two or three conversion events, only then the following tracking logic will take place:

  • Tracking Referrals:

    • When a user is referred to your campaign, they enter the first step of your multi-step conversion event.

    • At this point, a referral will be automatically created and marked as "Pending" within the appropriate campaign. This status indicates that the referral has begun the conversion process but hasn't yet completed all the necessary steps.

  • Non-Referrals:

    • If the user is not a referral (i.e., they weren't referred by someone else in your campaign), no action is taken. Specifically, no subscriber record will be created for them.

    • This ensures that only those users who are actually referred are tracked within the multi-step process.

Implementation Example

To add a pending referral, simply call ReferralHero's RH.pendingReferral() function, passing in user information such as an email address, name, or any other identifier set up for your campaign.

Here is an example of how to implement this:

<script type="text/javascript">
  window.RHConfig = {
    callbacks: {
      ready: function() {
        var form = document.getElementById('referral-form');
        
        form.addEventListener('submit', function(e) {

          // Collect form data
          var data = {
            name: form.querySelector('#name').value,
            email: form.querySelector('#email').value
          };

          // Call pendingReferral function with collected data
            RH.pendingReferral(data);
        });
      }
    }
  };
</script>

IMPORTANT

  • '#email, '#phone_number', '#crypto_wallet_address' or '#other ID' that have been enabled as the campaign unique identifier is required and can’t be blank.

  • The ReferralHero Dashboard, Signup, Floating Widget, or Javascript API can only be used once on a single webpage. Do not add them multiple times on the same webpage.

Check if a Pending Referral is Tracked or not

  1. Open the Console:

    • Before submitting the form, open your browser's Developer Tools and go to the Console tab.

  2. Submit the Form:

    • Fill in the form fields (e.g., name and email) and click "Submit."

  3. Check the Console:

  • After confirming in the console that the pending referral is tracked, you can then verify that the referral appears as "Pending" in your ReferralHero dashboard.

Last updated