Redirect Based on Webhook Response

Anonymous
Not applicable

Redirect Based on Webhook Response

We're looking to use a Marketo form for sign up on a product. When a user fills out this form Marketo collects their information and then uses a webhook to post it into our system.

Is it possible to redirect to a different follow up landing page based on the response from the webhook?

For example, if the webhook fails we send the user to an error landing page. If everything goes fine we send them to a "success" landing page.
Tags (1)
4 REPLIES 4
Kenny_Elkington
Marketo Employee

Re: Redirect Based on Webhook Response

Hey Sean,

I would not recommend trying to go through this route, as the latency between form followup, and return values from a webhook is too high to work with consistency.  If possible I would recommend using AJAX to pull values from your webhook and then pass them in the form fillout.  Doing so, you can leverage the conditional follow-up feature of Forms 2.0.  You can check out the forms API here: http://developers.marketo.com/documentation/websites/forms-2-0/
Anonymous
Not applicable

Re: Redirect Based on Webhook Response

If possible I would recommend using AJAX to pull values from your webhook and then pass them in the form fillout.

Could you expand on the above? What would my flow look like? This:
 
  1. User fills out form
  2. Webhook invoked
  3. ??Landing Page queries webhook??
  4. Redirect based on webhook query?
Kenny_Elkington
Marketo Employee

Re: Redirect Based on Webhook Response

Hey Sean,

It would look like this:

1. Users Fills Out Form
2. When the Submit button is pressed, during the onValidate or onSubmit callback, send an AJAX call to your webhook.
3. On AJAX success(or Failure), use the addHiddenFields() and vals() methods to create fields and values from the AJAX response which are posted to Marketo with the form submission.
4. Form is submitted, and then the followup is selected based on your rules for the form in Form Settings in Marketo.
Anonymous
Not applicable

Re: Redirect Based on Webhook Response

So I wouldn't actually be using a Marketo webhook in that case? I'd be making an AJAX request instead?