SOLVED

Capturing Lead Info From External Form

Go to solution
Moyes
Level 1

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

1 ACCEPTED SOLUTION
SanfordWhiteman
Level 10 - Community Moderator

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

View solution in original post

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

@Moyes please return to your thread and check responses.

Moyes
Level 1

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

SanfordWhiteman
Level 10 - Community Moderator

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