Custom Form

If you want new subscribers to use your existing forms instead of the Viral Loops Widgets, you will need to write some code to connect the Viral Loops campaign with your existing forms.

Let's say that you have the following HTML form and:

<form action="/action.php" onsubmit="registerUser()">
  <!-- First name input --> 
  First name: <input type="text" name="fname" id="vl_fname">
  <!-- Email input -->
  Email: <input type="email" name="email" id="vl_email">
  <!-- Submit button -->
  <input type="submit" value="Submit">

When the user submits the form, you can add them to the Viral Loops campaign like this:

function registerUser(){
  let vl_fname = document.getElementById("vl_fname").value;
  let vl_email = document.getElementById("vl_email").value;
    firstname: vl_fname,
    email: vl_email
  }, () => {
    console.log("User registered to Viral Loops!")