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 .

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,
            tags: ["tag1", "tag2"] // Optional ( assign tags to subscriber )
          };

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

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:

Pending Referral is successfully tracked (Referred by someone)
Pending Referral is successfully tracked (Referred by someone)
  • 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

Was this helpful?