Re: Marketo forms to send data to an external database

Nina_Gonzalez1
Level 3

Marketo forms to send data to an external database

What is the best way to use an embedded Marketo form that simultaneously sends data to an external database? Obviously, we can use an API to send data to Marketo, but if we want to use the advantages of an embedded marketo form, which still sending the same data to an external database.


We have a unique use case where our website is collecting a lot of information (which does not need to be in Marketo) to create a PDF report for the user. We want to send the standard new lead fields into Marketo: name, email, phone -- and send the same info to our external database that has all the other non-marketo information. We were hoping to do pre-filled and progressive forms, hence the reason we prefer to do embedded. It also gives us the flexibility of changing the form without going back to our developers every time. We also do not want to send duplciate leads into Marketo.

Is there a way to do this or do we have to use the API?

2 REPLIES 2
SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo forms to send data to an external database

Obviously, we can use an API to send data to Marketo...

Bad idea anyway...

We were hoping to do pre-filled and progressive forms, hence the reason we prefer to do embedded. It also gives us the flexibility of changing the form without going back to our developers every time. We also do not want to send duplciate leads into Marketo.

This is very, very simple if you have a competent developer. Simply use the Forms (JS) API -- that's the client-side API and must not be confused with SOAP or REST APIs -- to relay the same fields to your external service in an onSuccess listener.

It's the same concept as sending, say, a hit to Google Analytics in the onSuccess, you just happen to be posting all the form data to another service.

Kenny_Elkington
Marketo Employee

Re: Marketo forms to send data to an external database

You can use the Forms 2 javascript API to hook into submission events and send your data over AJAX to your service.  onSubmit and onSuccess are the typical callbacks you would use depending on your specific needs.  You can find the reference here, and some examples of how to use the callbacks here