Integrate Marketo Form with 3rd party service | Community
Skip to main content
Level 2
October 27, 2022
Solved

Integrate Marketo Form with 3rd party service

  • October 27, 2022
  • 3 replies
  • 4780 views

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

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

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.

3 replies

Katja_Keesom
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
October 27, 2022

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
October 27, 2022

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.

Level 2
October 27, 2022

@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
SanfordWhitemanAccepted solution
Level 10
October 27, 2022

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
Community Advisor
Community Advisor
October 28, 2022

@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
October 28, 2022

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

Level 2
October 30, 2022

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