Track referral on Sign Up page
Step-by-Step Referral Tracking Implementation
// Add this script in the HEAD tag
<script type="text/javascript" campaign-id="YOUR-CAMPAIGN-ID" defer src="https://app.referralrocket.io/widget/widgetIndex.js"></script>window.onload = function() {
//REPLACE WITH YOUR FORM ID
const form = document.getElementById("signupForm");
form.onsubmit = function(event) {
event.preventDefault();
// Collect user information | REPLACE WITH YOUR FIELD ID
const userData = {
email: document.querySelector("input[name='email']").value,
firstName: document.querySelector("input[name='firstName']").value,
lastName: document.querySelector("input[name='lastName']").value
};
// Send participant data to Referral Rocket
if (window.Rocket) {
window.Rocket.getCampaign().addParticipant(userData);
}
};
};(Alternative Method): Automatically add hidden referral field to your form
Last updated