Wednesday, 28 March 2012

Web to Lead to Subscription

[Note: This is a revised version of the old post published in February 2011, incorporating the new feature from the Connector]

If you or your client already have an existing Salesforce Web-to-Lead form (such as "contact us" or "sign up" forms), you may want to add those new leads to your subscriber list in Campaign Monitor automatically.

There are several different ways to create a subscribe form that works with both Campaign Monitor and Salesforce depending on your specific scenario. In this post, I'm going to show you how you can leverage SNB Apps Campaign Monitor Connector Extension for Salesforce so you can create not only a new lead in Salesforce, but also add the lead to your subscriber list with these two transactions seamlessly integrated.

First, you must have installed the latest version of the Connector in your Salesforce org, and have done the post-install configurations. If you need detailed step-by-step instructions on the configurations for leads, please refer to our blog post Integrating Salesforce Leads with Campaign Monitor.

After you complete installing and configuring the Connector, you have to install the Connector Extension in order to make the automatic subscription from Web-to-Lead work.

For this example, let's say you want to have a Web-to-Lead form on your client's site, like the following:

If your Web-to-Lead form is set up correctly, when a visitor enters information on the form and submits it, it should create a lead record in your Salesforce app. For this scenario, when this lead creation happens, you want to send a request to Campaign Monitor, automatically, to add the new lead's email address and name to a particular subscriber list, and to display it in the lead's Salesforce detail page as well.

To make all these work, let's create a Web-to-Lead form first. Go to Setup > App Setup > Customize > Leads > Web-to-Lead, and click the Create Web-to-Lead Form button. Since you want to include two checkboxes for two different subscriber lists, move the following fields (that come with the Connector Extension package) from Available Fields to Selected Fields:

  • Subscribe to List 1: Checkbox field for the frist list (Newsletters)
  • List Record ID 1: Text field to specify the record ID of the first subscriber list
  • Subscribe to List 2: Checkbox field for the second list (Promotions)
  • List Record ID 2: Text field to specify the record ID of the second subscriber list

Salesforce will generate the HTML code for you. the bottom part will look something like this:

Subscribe to List 1:<input  id="00NF0000005yyRa" name="00NF0000005yyRa" type="checkbox" value="1" /><br>

List Record ID 1:<input  id="00NA000000761ji" maxlength="100" name="00NA000000761ji" size="20" type="text" /><br>

Subscribe to List 2:<input  id="00NF0000005yyRf" name="00NF0000005yyRf" type="checkbox" value="1" /><br>

List Record ID 2:<input  id="00NA000000761jm" maxlength="100" name="00NA000000761jm" size="20" type="text" /><br>

Now you will have to find out the values of the record IDs of your two subscriber list in Salesforce, so your Web-to-Lead form knows which subscriber lists to work with. The easiest way to get the record ID of a Salesforce record is looking at the URL box of the browser. For example, in my test Salesforce app, the record ID of the Newsletters List subscriber list can be found here:

Once you have the record IDs of the subscriber list records in Salesforce, you will now have to make a little bit of modification in HTML. In the input tag for the List Record ID 1 field, add the value attribute and assign the record ID value. And you may want to make this field hidden, as following:

List Record ID 1:<input value="a03F0000004pE5R" id="00NA000000761ji" maxlength="100" name="00NA000000761ji" size="20" type="hidden" /><br>

Do the same for List Record ID 2. Save the HTML file you just edited and open it with a web browser. The form will look now something like this:

It looks almost like the first form we wanted to create, right? From here you should be able to modify the HTML form to make it look exactly the way you want it to. The important thing is that when your prospect fill in the form and check those boxes, not only will a lead be created in Salesforce, but it will also subscribe the lead's email address to your subscriber list in Campaign Monitor and create corresponding List Subscription records under the lead detail page as well.

Let's test it. Fill in the form and select one or both of the checkboxes for the subscriber lists. And click Submit.

Since Roger Federer wanted to checked both Newsletters and Promotions, the lead record created in Salesforce will look something like:

Also in Campaign Monitor, Roger Federer should be subscribed to those two lists by now:

One last important thing to note is that this method only works with a single lead creation such as Web-to-Lead, not with bulk creations such as data import. Both Salesforce and Campaign Monitor have very strict API governance limits so that not too many API calls are made in a single transaction.

No comments:

Post a Comment