SOLVED

Send Lead Data from MKTO to SFDC Web-to-Lead Form

Go to solution
Highlighted

Re: Send Lead Data from MKTO to SFDC Web-to-Lead Form

Added a custom header and still not seeing anything. Is there a way to know

where/how it's failing?

Highlighted

Re: Send Lead Data from MKTO to SFDC Web-to-Lead Form

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

Highlighted
Level 7 - Champion Alumni

Re: Send Lead Data from MKTO to SFDC Web-to-Lead Form

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.

Highlighted
Level 10 - Community Moderator

Re: Send Lead Data from MKTO to SFDC Web-to-Lead Form

Can you paste the web-to-lead HTML form into a CodePen? Then I'll tell you what webhook you need.

Highlighted
Level 7 - Champion Alumni

Re: Send Lead Data from MKTO to SFDC Web-to-Lead Form

https://codepen.io/VHolmes/pen/KyLGxB  - obviously OID is fake

Highlighted
Level 10 - Community Moderator

Re: Send Lead Data from MKTO to SFDC Web-to-Lead Form

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.

Highlighted

Re: Send Lead Data from MKTO to SFDC Web-to-Lead Form

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.

Highlighted
Level 7 - Champion Alumni

Re: Send Lead Data from MKTO to SFDC Web-to-Lead Form

Yep, doing all those things. Really driving me bonkers now. Thanks for the help though!

Highlighted
Level 10 - Community Moderator

Re: Send Lead Data from MKTO to SFDC Web-to-Lead Form

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.

Highlighted
Level 7 - Champion Alumni

Re: Send Lead Data from MKTO to SFDC Web-to-Lead Form

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.