Create Subscriber Web Form

Subscriber Web Forms

If you need to add custom “Subscribe to our newsletter”, “opt-in” or “opt-out” links on your website, see below for creating the necessary web form and html code to insert into your website.

Note: Recipients of your newsletters will still have the ability to interact with the Subscription Center and Profile Center, accessible from received emails (footer links).

Unsubscribe/Subscribe Forms

Before you set up the Web Collect form, you’ll need the following information:

  • The List ID (LID) for the list(s) you wish to use
  • Your account’s Member ID (MID)

Finding Your List ID

To find your List ID, navigate to your List. Check the box next to your list. Click on Properties.

Finding Your Business Unit ID

To find your Business Unit MID, hover your mouse over Business Unit selection menu.

dropdown for business unit id

Web Collect Code Sample

The following code will allow you to opt-in or opt-out of your newsletter. When subscribed it will add the subscriber key and validate the email address. There are fields for first and last name, which are required.

Note: The subscriber, when added, is checked against the Service Cloud database. If a user is in the Service Cloud database it will import the subscriber with the Salesforce ID.

<form action="" class="generic_form" id="subscribeForm" method="post" name="subscribeForm">

<input name="thx" type="hidden" value="Link to your success or thank you page here"/>
<input name="err" type="hidden" value="Link to your error page here"/>
<input name="usub" type="hidden" value="Link to your thanks you have unsubscribed page here"/>
<input name="MID" type="hidden" value="YOUR MID # GOES HERE"/>
<input id="subkey" name="ETSubscriberKey" type="hidden" value=""/>

<p><label for="first">First Name</label><br/>
<input id="first" name="First Name" size="25" type="text"/></p>
<p><label for="last">Last Name</label><br/>
<input id="last" name="Last Name" size="25" type="text"/></p>
<p><label for="email">* E-mail Address</label><br/>
<input id="email" name="Email Address" size="25" type="text"/></p>
<p>Please subscribe me to:</p>
<p><input checked="checked" id="slid_10" name="lid" type="checkbox" value="LIST ID# GOES HERE"/>
<label for="slid_10"> NAME OF LIST</label><br/>

<p><input id="plain" name="Email Type" type="radio" value="TEXT"/>
<label for="plain"> Plain-text</label><br/>
<input checked="checked" id="html" name="Email Type" type="radio" value="HTML"/>
<label for="html"> HTML</label></p>
<p><input checked="checked" id="sub" name="SubAction" type="radio" value="sub_add_update"/>
<label for="sub"> Subscribe</label><br/>
<input id="unsub" name="SubAction" type="radio" value="unsub"/>
<label for="unsub"> Unsubscribe</label></p>
<input id="form-submit-subscribe" name="submit" type="submit" value="Submit"/>


Add the following to the javascript for the page.

<script src=""></script>
       $("#email").focusout( function(){
            $("#subkey").val( $("#email").val() + "." + $("input[name='MID']").val() );