We are migrating from Pardot to Marketing cloud, and i'm trying to figure out the process of lead generation in Marketing Cloud.

Today, forms on our landing pages post data to form handlers in Pardot, eventually creating leads in Sales Cloud (The lead is created as Prospect in Pardot and then sent to SF).

Now with Marketing cloud, from trailheads it says that we need to create cloud pages of all the forms that we have in our website in marketing cloud in web studio and inside those landing pages we create smart capture forms. is it done this way?

Can't we just keep the forms where they are today, and build a solution which will receive the form post in Salesforce Marketing Cloud, and eventually create the lead in Sales Cloud - similar to the behaviour of Pardot form handlers?

1 Answer 1


You can build a custom "form handler" using code resources in Cloud Pages. You will need a combination of:




In the page where you want to collect your leads, you must place a form with action URL pointing to code resource:

<form action="https://subdomain.example.com/yourcoderesource" method="post">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  Email: <input type="text" name="email"><br>
  Company name: <input type="text" name="cname"><br>
  <input type="submit" value="Submit">

In the code resource, all the parameters posted can be retrieved using RequestParameter AmpScript function:

SET @fname = RequestParameter("fname")
SET @lname = RequestParameter("lname")
SET @email = RequestParameter("email")
SET @cname = RequestParameter("cname")

You should check, whether a lead already exists with this email address, and update if exists or create if email address is not known:

SET @lead = RetrieveSalesforceObjects('Lead', 'Id', 'Email', '=', @email)
IF RowCount(@lead) > 0 THEN
SET @result = UpdateSingleSalesforceObject('Lead',Field(Row(@lead, 1),Id),Firstname,@fname,Lastname',@lname)
OUTPUT(CONCAT("Existing lead was updated: ",@result))
SET @result = CreateSalesforceObject('Lead', 3, 'FirstName', @fname, 'LastName', @lname, 'Email', @email, 'Company', @cname)
OUTPUT(CONCAT("New lead was created: ",@result))
OUTPUT("Email must be provided in form")
  • Oh thank you that's really helpful. My only concern here is, should we re-create all the current landing pages that we have now in our website in Cloud pages in Marketing cloud first ? then we build the code resource in each one of them ? and are can we still track the lead source ( facebook ads, generic search, partners,.. )somehow in these cloud pages ?
    – Ben M.
    Apr 29, 2019 at 19:52
  • 2
    You don't need to build the landing pages in Cloud Pages. Any website with a form will do. Of course you will, similar to a number of Pardot Form Handlers, need a number of CP code resources, each with capability to process specific set of fields. To track source which sends the lead to the landing page, additional logic should be built, setting a number of hidden fields in the form, based on the source. This could be a field for storing the utm strings from the url. It takes a LOT of customisations to recreate just some of the features of Pardot in SFMC. Apr 29, 2019 at 19:55
  • Let me know if you have more questions, otherwise don't forget to accept and upvote, if you find my answer helpful Apr 30, 2019 at 14:06
  • 1
    Yes it was helpful , thank you ! Our partner suggested to use web to lead from Sales cloud which is a little bit easier however it generates just up to 500 leads a day and i'm not sure if there is any cons to it as well ..
    – Ben M.
    May 1, 2019 at 16:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .