Custom Form

📘

Snippet Installation Need

Make sure you have completed the Installation Step

Integrating a simple custom Form

To use a custom form with Viral Loops you need to add some custom data-attributes to its HTML.

<form
       data-vl-campaign-id="your-campaign-id"
       data-vl-container="join-stage"
       data-vl-action="join-stage#join">
   <input
     data-vl-join-stage-target="input.email"
     type="email"
     placeholder="Enter your email"
   />
   <input type="submit" />
 </form>
  1. Copy the HTML code into your website or content management system.
  2. Replace "your-campaign-id" in data-vl-campaign-id with the actual ID of your campaign in Viral Loops
  3. Set data-vl-container to "join-stage" to indicate that this is the Join Stage of your campaign.
  4. Set data-vl-action to join-stage#join to indicate that users will join the campaign after the form submission
  5. Add data-vl-join-stage-target to your input fields, and define their type by usinginput.email, input.firstname, and input.lastname
  6. Test it out!

What’s Next

Enclose your form in a Join Stage and decide what happens after the form submission!