[SalesForce] SFMC Smart Capture Form: Automatically create lead in SFDC and use lead ID as subscriber key

We're in the process of setting up Salesforce marketing cloud, and hit a couple snags. Basically, we have marketing cloud connect up and running, we see the synced salesforce lead object data extension and can send to it (a filtered one, anyway… Although for some reason personalization variables aren't working yet) BUT:

We want to use cloudpages to host a smart capture form, and we'd like submissions of that form to automatically create a lead in sfdc and use that leadID as the subscriber key. Just can't figure this out.

Basically, the form submission is a new lead submission, meaning it needs to get into sfdc, which uses the LeadID as the Subscriber key, so it makes sense that the smart capture submission needs to use leadID to prevent duplication… Right? Also, how fast is that sync? Would we be able to use the LeadID (or really, other info like lead owner name) on the cloud pages smart capture form confirmation page?

Eg: they user submits a form with their name/email/etc, the landing page says "Hi! Thanks for submitting the form! Here's the unique calendar scheduler link for your rep/lead owner!"

Thanks, in advance!

Best Answer

It's hard to give you much more than a few pointers as your question covers quite a number of points. I'll just provide some high-level considerations:

  1. Salesforce is your system of record, so I'd be inclined to just read and write from CRM, rather than use your synchronised data - it is not completely up-to-date
  2. Smart Capture writes to Data Extensions. You would need to do some coding of a Custom Landing Page to implement your business rules and write directly to CRM
  3. You can retrieve CRM leads to try to identify whether you already have the individual captured as a Lead - potentially using Email Address to search for them. See RetrieveSalesforceObjects with AMPScript
  4. You can create new leads using CreateSalesforceObject and it will return the new ID for the Lead. See this example.
  5. You could then do a further RetrieveSalesforceObjects to get any other details of the Lead you have just created, like the Owner information and the likes and display this information on the page.
  6. If you want to send an email to the new lead, I'd recommend again treating CRM as your system of record and have it fire the email on the new lead creation, either through Journey Builder Salesforce Events or Salesforce Triggered Sends

Finally, there's likely going to be quite a lot of reading and writing to CRM in this application you'll be putting together, so I'd recommend separating out your form as a landing page and create a resource that does processing for you based on AJAX calls from your landing page. You'd want to not leave the visitor staring at an unresponsive form while you go and search CRM for their email address, create a new Lead and then read back any other information you need for the confirmation page. An example of a processing page for an unsubscribe page may give you some helpful hints on how to read and write from CRM from a Code Resource page that's accessed with AJAX.

Related Topic