Skip to main content
Question

Help with Redirecting Users Based on Multiple Webhook Responses from Zapier


I’m working on an integration between WPForms and Zapier to process voucher data on my website, and I need assistance with redirecting users based on a variety of responses sent from Zapier. Here’s an outline of my setup and what I’m aiming to achieve:

My Setup:

  1. Trigger: When a user submits a form on WPForms, a Catch Hook in Zapier captures the data.
  2. Processing in Zapier: Zapier processes the data (e.g., checking if the voucher is valid, member ID matches, if vouchers are available, etc.) and determines one of several possible outcomes.
  3. Webhook Response: Based on the result, Zapier sends a response back to my website via a Webhook. These responses could vary, for example:
    • "voucher_status": "valid" (Voucher successfully redeemed)
    • "voucher_status": "member_id_invalid" (Member ID not valid)
    • "voucher_status": "name_mismatch" (Member ID and last name don’t match)
    • "voucher_status": "no_vouchers_left" (No vouchers left)

My Goal:

I want to redirect users to different confirmation pages based on the specific response sent from Zapier. For example:

  • Redirect to /voucher-success/ if the voucher is valid.
  • Redirect to /voucher-member-id-invalid/ if the member ID is invalid.
  • Redirect to /voucher-name-mismatch/ if the member ID and last name don’t match.
  • Redirect to /voucher-no-vouchers-left/ if the user has no remaining vouchers.

The Problem:

  • Zapier cannot directly perform redirects, so I’m using JavaScript on my Processing Page to handle the redirection.
  • The webhook sends a GET request (or POST, if that’s better) to my website with the appropriate response.
  • I need the Processing Page to capture this response and handle the redirection based on the different voucher_status values.

My Question:

  • Can Zapier send multiple possible responses (like "voucher_status": "valid", "voucher_status": "member_id_invalid", etc.) to my website?
  • How can I handle these different responses on the Processing Page? I want JavaScript to check the response and redirect users accordingly to different pages based on what Zapier sends.

I’ve seen conflicting information, so I’d really appreciate some guidance on the best way to implement this and whether it’s possible to pass multiple responses from Zapier to trigger the right redirection.

Thanks in advance for your help!

Did this topic help you find an answer to your question?

0 replies

Be the first to reply!