SOLVED

Integrate Marketo Form with 3rd party service

Go to solution
michaelhorwitz
Level 1

Integrate Marketo Form with 3rd party service

Whats the best method to send data from a Marketo form embedded on our website to a 3rd party service?

 

We need to take the information from the Marketo fields put it into an array and send it via CURL. In the header we need to include authorization token.

 

We get a response from the service 

 Success- direct user to confirmation page,

 error we display error message on page.

 

Would the webhooks be the right approach?

https://developers.marketo.com/webhooks/

 

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Integrate Marketo Form with 3rd party service


We need to take the information from the Marketo fields put it into an array and send it via CURL. In the header we need to include authorization token.

I doubt that. The use of cURL vs. another HTTP library is an implementation detail. No service actually cares if you use cURL to send data to it.

 

What you want to do here is fire a standard XMLHttpRequest or Fetch from the browser within a Marketo Forms 2.0 onSuccess listener function. This lets you control where the browser goes next. Naturally the 3rd-party service needs to accept those XHR/Fetch requests: they’ll be cross-origin requests by definition, so the correct CORS headers need to be included by the service.

View solution in original post

9 REPLIES 9
Katja_Keesom
Level 10 - Community Advisor

Re: Integrate Marketo Form with 3rd party service

That would certainly work. You can use the form fill trigger to call the webhook and map the response in the setup of your webhook.

SanfordWhiteman
Level 10 - Community Moderator

Re: Integrate Marketo Form with 3rd party service

No, webhooks won’t work here. A webhook fires after the form has been submitted to Marketo, from within the Marketo platform. So you can’t use a webhook response to redirect someone’s browser to a new location.

michaelhorwitz
Level 1

Re: Integrate Marketo Form with 3rd party service

@SanfordWhiteman So we would have to redirect them immediately to confirmation page after they complete the form. This means we wouldnt be able to catch the errors from the webhook and display a message to end user.

 

What about creating an HTML form and sending data to Marketo and service simultaneously?

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Integrate Marketo Form with 3rd party service

There's no reason whatsoever to use another form. Marketo forms have a robust event model that lets you do whatever you want after the Marketo form successfully submits. You don't need to redirect at all if you don't want to, or you can delay redirection until you get results from another service.
SanfordWhiteman
Level 10 - Community Moderator

Re: Integrate Marketo Form with 3rd party service


We need to take the information from the Marketo fields put it into an array and send it via CURL. In the header we need to include authorization token.

I doubt that. The use of cURL vs. another HTTP library is an implementation detail. No service actually cares if you use cURL to send data to it.

 

What you want to do here is fire a standard XMLHttpRequest or Fetch from the browser within a Marketo Forms 2.0 onSuccess listener function. This lets you control where the browser goes next. Naturally the 3rd-party service needs to accept those XHR/Fetch requests: they’ll be cross-origin requests by definition, so the correct CORS headers need to be included by the service.

Jo_Pitts1
Level 10 - Community Advisor

Re: Integrate Marketo Form with 3rd party service

@michaelhorwitz ,

what is the use case?  I don't think you've given us enough information to work out how to help you.

Why send it to a third party service for validation?  

Why not use JS on page to do the validation?

etc.

SanfordWhiteman
Level 10 - Community Moderator

Re: Integrate Marketo Form with 3rd party service

I assume it’s something like an email validation service or an enrichment service. So not something that could be reimplemented locally.

michaelhorwitz
Level 1

Re: Integrate Marketo Form with 3rd party service

The service is our user management platform. Basically we are offering a version of a free trial of our software.

 

Website visitor fills out lead form and we create an account for them. We need to check if the user exists already in our database. If they do we return a response saying "this user already exists".

SanfordWhiteman
Level 10 - Community Moderator

Re: Integrate Marketo Form with 3rd party service

Makes sense, definitely integratable using the method described above.