The "Refer a Friend" template comes with its own form as part of the In-app Referral Widget™. However, if you would rather have participants join in a different way, you can do that too with a little bit of coding.
This is useful in several cases:
You have a web app and you want your users to see the In-app Referral Widget only after they have logged in.
Your landing page is built on Unbounce, Instapage or other similar CMS and you want participants to join the referral campaign only after submitting one of the forms on your website.
You want people to verify their email address before joining as participants in your referral campaign.
In such cases, you need to manually submit the participant to Viral Loops.
<body> tag in your page. You can get this snippet at the Installation step of your campaign wizard.
After the form is submitted, run the identify method to add the participant to the campaign.
If you want to add the new participants over the Web API, use the Registration method.
However, after that part, you will still need to run the client-side
identify as before, so that the widget will load the user's unique referral URL and sharing options.
If you want to capture GDPR consent as well, add the
consents property in the
user object. The Consent ID can be found in the Settings Page of the app, where the GDPR consents are added.
Note: This article does not apply to Squarespace pages, due to restrictions/limitations.