Capturing Lead Info From External Form | Community
Skip to main content
Level 2
April 7, 2025
Solved

Capturing Lead Info From External Form

  • April 7, 2025
  • 2 replies
  • 715 views

Hello, 

 

We are about to launch an "sub" product/website. The website has a non-Marketo form that is used create an account and to gain access to the content. 

What I would like to do is capture these form fills in Marketo, and update or create leads. In most instances, it would be just simply checking a box to say they have completed the external form. For some, to capture all other usual lead data. 

 

What is the best way of doing this? 

Thanks
Rob

Best answer by SanfordWhiteman

For some, to capture all other usual lead data. 

Well, if you sometimes need to do this, your code must support it. Doesn’t matter if it’s not always used!

 

The approach is to

  • listen for the visible form’s submit event
  • preventDefault()
  • pass the visible form’s values to a hidden Marketo form
  • listen for the Marketo form’s success event
  • submit the hidden Marketo form
  • in the Marketo onSuccess, POST to the visible form’s original destination

An example of the logic is here:

 

HTML :: Vanilla HTML <form> to hidden Marketo form (with HTML submit)

 

Naturally your developer needs to be familiar with the nuances of such DOM form and Marketo form events.

 

Also, this demo assumes the visible form is using native <form> submit handling. If it has its own custom handler, you need to short-circuit that logic and then continue with the same pattern (Marketo form, onSuccess, then visible form).

2 replies

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
April 7, 2025

For some, to capture all other usual lead data. 

Well, if you sometimes need to do this, your code must support it. Doesn’t matter if it’s not always used!

 

The approach is to

  • listen for the visible form’s submit event
  • preventDefault()
  • pass the visible form’s values to a hidden Marketo form
  • listen for the Marketo form’s success event
  • submit the hidden Marketo form
  • in the Marketo onSuccess, POST to the visible form’s original destination

An example of the logic is here:

 

HTML :: Vanilla HTML <form> to hidden Marketo form (with HTML submit)

 

Naturally your developer needs to be familiar with the nuances of such DOM form and Marketo form events.

 

Also, this demo assumes the visible form is using native <form> submit handling. If it has its own custom handler, you need to short-circuit that logic and then continue with the same pattern (Marketo form, onSuccess, then visible form).

SanfordWhiteman
Level 10
April 10, 2025

@moyes please return to your thread and check responses.

MoyesAuthor
Level 2
April 15, 2025

Thank you for your reply @sanfordwhiteman 

I have just had the meeting with the guy who is running this project (with the external form). I will no doubt return to this thread when we run into problems! 🙂