Hi Community!
Looking to see if someone has had experience passing/posting data from their Marketo instance to another company's SFDC Web-to-Lead form?
We've recently started working very closely with a partner and are planning to share leads with them. They have shared with us a SFDC Web-to-Lead form and I was curious if there is a way to post to that form using a Webhook (I think the answer is yes, but how to set up this particular webhook I'm not certain about). Ideally, I would like to include it as a flow step in my trigger campaign whenever someone fills out the form on that particular partner's page. Or maybe there is a better way of accomplishing this goal?
Thanks.
Solved! Go to Solution.
Hi Valerie,
Cross-posting to Web2Lead is quite easy. The webhook URL is the SFDC endpoint. Request encoding is Form/URL. Then include the fields in the template like
fieldname1={{lead.field1}}&fieldname2={{lead.field2}}
Hi Valerie,
Cross-posting to Web2Lead is quite easy. The webhook URL is the SFDC endpoint. Request encoding is Form/URL. Then include the fields in the template like
fieldname1={{lead.field1}}&fieldname2={{lead.field2}}
Sanford Whiteman Is this somehow altered by SFDC picklist fields or fields not selectable in the W2L setup (Lead Status in this case)?
Between this (which successfully posts to SFDC):
<form action="https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
<input type=hidden name="oid" value="XXXXXXXXXXX">
<input type=hidden name="retURL" value="http://">
<label for="first_name">First Name</label><input id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>
<label for="last_name">Last Name</label><input id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br>
<label for="email">Email</label><input id="email" maxlength="80" name="email" size="20" type="text" /><br>
<label for="company">Company</label><input id="company" maxlength="40" name="company" size="20" type="text" /><br>
<label for="city">City</label><input id="city" maxlength="40" name="city" size="20" type="text" /><br>
<label for="state">State/Province</label><input id="state" maxlength="20" name="state" size="20" type="text" /><br>
<label for="title">Title</label><input id="title" maxlength="40" name="title" size="20" type="text" /><br>
Department:<input id="00NA0000001ieJh" maxlength="80" name="00NA0000001ieJh" size="20" type="text" /><br>
<label for="lead_source">Lead Source</label><select id="lead_source" name="lead_source">
<option value="Marketing: Marketo">Marketing: Marketo</option>
</select><br>
<input type="submit" name="submit">
</form>
...and this (which doesn't):
It seems like something is getting lost in translation. I'm guessing that I'm missing something obvious here.
What are the Activity Details for the Call Webhook Activity in a lead's Activity Log? (Click the Activity ID link.)
Webhook Id:
1
Webhook Name:
Web2Lead (SFDC)
Person ID:
1
Response Code:
1000
Response Code 1000 means you were calling the webhook from a batch. Can't do that directly. You have to use Request Campaign/Campaign is Requested.
Thanks Sandy. Here's the corrected log then:
Webhook Name: Web2Lead (SFDC)
Request Type: http_post
Url: https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8
Pay Load:
oid=XXXXXXXXXXX&first_name=Robert2&last_name=Kelen&email=robert.kelen%2Btest2%
40leadous.com
&company=Acme&city=Unknown&state=Unknown&lead_source=Marketing%3A%20Marketo&title=Unknown&00NA0000001ieJh=Unknown&retURL=http://
Response:
Person ID: 1
Response Code: 200
OK, so that's a 200 OK on the pure HTTP level, which is good... still not creating an SFDC lead?
Nope. Still no lead.
Set a custom header (I forgot to suggest this before) on the hook:
Content-Type application/x-www-form-urlencoded
Added a custom header and still not seeing anything. Is there a way to know
where/how it's failing?
Thanks to Sanford Whiteman's generous assist, I now know the missing piece to getting this to function properly, and wanted to share here in case anyone stumbles over this. The key is in the last line of the salesforce W2L code (<input type="submit" name="submit">). That too needs to be added to the payload template, such that the final string in this example reads like this: oid=000000000000000&first_name={{lead.First Name}}&last_name={{lead.Last Name}}&email={{lead.Email Address}}&company={{company.Company Name:default=Unknown}}&city={{lead.City:default=Unknown}}&state={{lead.State:default=Unknown}}&lead_source=Marketing%3A%20Marketo&title={{lead.Title:default=Unknown}}&00NA0000001ieJh={{lead.Department:default=Unknown}}&retURL=http://&submit=Submit
Hey - did you end up needing the custom header? I'm building this right now and thanks very much for the above as I had not added the submit, but my webhook is still failing to post, with an almost identical config to the above (just limited to email, first, last and company fields).
Also, should it be submit=submit or submit=Submit (capitalisation) - I'm down to the miniscule details here, genuinely can't think of what else to try.
Veronica, two small things that stymied my early efforts in case this helps:
- field validations in Salesforce for the fields in question (make sure test values passed from Marketo are valid from SFDC's point of view; I added valid default values to prevent blanks on the tokens as well)
- webhook needs to be called from a triggered campaign (not batch or manual)
Also, in my case Submit was capitalized, though not sure if that was important.
Yep, doing all those things. Really driving me bonkers now. Thanks for the help though!
If you want to DM me we can find the problem quickly, I'm sure. Robert and I only looked at it for a sec with my test server and saw the gap.
Can I confirm something? this custom header thing is bothering me because I have never had to set it before to make it work. According to the value you wrote above, the Header is Content-Type, and the Value is application/x-www-form-urlencoded ?
I have never used this setting before and I've got no idea what it is for.
WORKING! I changed the order of the layload template to put orgID last as per Sanford's example above. Should not have made a difference but it did. Thanks all - appreciate the assistance. I'll make a special effort to answer some more questions on community today to pay it forward/back/whatever
Can you paste the web-to-lead HTML form into a CodePen? Then I'll tell you what webhook you need.
https://codepen.io/VHolmes/pen/KyLGxB - obviously OID is fake
Looks the same as Robert's as far as I can see/remember...
The URL is
https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8
and POST payload is
first_name={{Lead.First Name}}&last_name={{Lead.Last Name}}&email={{Lead.Email Address}}&company={{Company.Company Name}}&oid=XXXXXXXXXXXXXXX&retURL=http://&submit=Submit
Remember that all param names are case-sensitive, and set the encoding to Form/Url.