Skip to main content
Level 2
Oct 27, 2022 5:41 AM UTC
Solved

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

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
SanfordWhiteman
SanfordWhitemanAccepted solution
User Group Leader
Oct 27, 2022 7:36 AM UTC

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.

9 replies

Katja_Keesom
Adobe Champion and Community Advisor
Adobe Champion and Community Advisor
Oct 27, 2022 7:06 AM UTC

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.

Translate
SanfordWhiteman
User Group Leader
User Group Leader
Oct 27, 2022 7:33 AM UTC

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.

Translate
Level 2
Oct 27, 2022 8:11 AM UTC

@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?

 

Translate
SanfordWhiteman
User Group Leader
SanfordWhitemanUser Group LeaderAccepted solution
User Group Leader
Oct 27, 2022 7:36 AM UTC

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.

Translate
Jo_Pitts1
Community Advisor
Community Advisor
Oct 28, 2022 2:14 AM UTC

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

Translate
SanfordWhiteman
User Group Leader
User Group Leader
Oct 28, 2022 2:35 AM UTC

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

Translate
Level 2
Oct 30, 2022 6:38 AM UTC

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

Translate