When a new visitor submits a form on my site, can I restrict signups to only those who have been referred?

When a new visitor submits a form on my site, can I restrict signups to only those who have been referred?

When a new visitor happens upon your site (either directly or via referral link), GrowSurf needs to register their email into your campaign by adding them as a new participant. Every visitor who submits a form on your site will be added as a new participant (and not just the individuals who followed a unique link from a referrer). If they were referred, GrowSurf associates them with their referrer and their referrer will immediately receive credit.

However, let's say that you are running a referral program where you want to restrict the visitors who can sign up for your product/service to only those who have been referred.  There are two ways to achieve this: either through checking a box in your campaign editor or programmatically using the JavaScript Web API.


Restrict signups when using the automagic form detection method

If you are using the automagic form detection method for referral tracking, you can restrict individuals added as new participants to only individuals who were referred. Simply check the box next to "Only add new participants if they were referred" (Campaign Editor > Installation > Choose forms from your site to automatically track).

Restrict signups when using the programmatic method

As an alternative, you can use the GrowSurf JavaScript Web API to detect if a visitor used a unique referral link to visit your webpage and only add a participant if that was the case. To do this you can view this tutorial or follow the steps below:

  1. In the Campaign Editor > Installation > Choose how to add participants to your campaign step, select "Programmatically using the GrowSurf API".
  2. Using JavaScript, add a new onSubmit event listener to the form that you want to track referrals on.
    1. If you are using a HubSpot form, there is a documented onFormSubmit callback you must use.
  3. Use the growsurf.getReferrerId() method to detect if a visitor used a unique referral link to visit your webpage.
    1. If the method returns a value, then they were referred. You can then add them as a participant using the appropriate method below:
      1. If your referral trigger is "Sign Up", then call growsurf.triggerReferral(). This will add the individual as a participant, trigger the referral, and the referrer will receive credit.
      2. If your referral trigger is "Sign Up + Qualifying Action", then call growsurf.addParticipant(). This will add the individual as a participant and associate the referrer to the new participant (but will NOT trigger the referral).
    2. If the method returns null, then do nothing.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.