Skip to main content
Level 2
Apr 7, 2025 10:35 AM UTC
Solved

Capturing Lead Info From External Form

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

SanfordWhiteman
SanfordWhitemanAccepted solution
User Group Leader
Apr 7, 2025 4:34 PM UTC

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).

3 replies

SanfordWhiteman
User Group Leader
SanfordWhitemanUser Group LeaderAccepted solution
User Group Leader
Apr 7, 2025 4:34 PM UTC

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).

Translate
SanfordWhiteman
User Group Leader
User Group Leader
Apr 10, 2025 12:32 AM UTC

@moyes please return to your thread and check responses.

Translate
MoyesAuthor
Level 2
Apr 15, 2025 9:48 AM UTC

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! 🙂 

Translate