Webhook Listener

📅 Published on

📝 Last updated

We’re currently revamping our documentation for 4.0.
See old documentation →

Documentation

»

Triggers

»

Webhook Listener

Overview

The Webhook Listener Trigger in Groundhogg allows you to initiate flow actions based on data received from external sources via HTTP POST requests. It captures incoming data, maps it to contact fields, and triggers subsequent actions in your flow, enabling seamless integration with third-party applications.

When to Use

Use the Webhook Listener Trigger when you need to connect Groundhogg with external systems, such as CRMs, payment gateways, or custom applications, that send data via webhooks. It’s ideal for automating contact management tasks based on events occurring outside your WordPress site, like form submissions or transaction completions.

How It Works

The Webhook Listener Trigger accepts POST requests with JSON or x-www-form-urlencoded payloads. You configure a unique Listener URL in Groundhogg, which external systems use to send data. The trigger captures the incoming request, allows you to map request fields to Groundhogg contact fields (e.g., first name, email), and initiates flow actions. You can also define the response output, such as the contact record or custom JSON, and track conversions for funnel reporting.

Setup Instructions

  1. Add the Trigger to Your Flow:
  2. Configure the Listener URL:
    • Copy the unique Listener URL provided in the trigger settings.
  3. Test the Webhook:
    • Use a tool like Postman (available at postman.com).
    • Create a new POST request and paste the Listener URL.
    • In the Body tab, select “raw” and enter sample JSON data, e.g.:{ "first_name": "Phil", "last_name": "Groundhogg", "email": "[email protected]" }
    • Send the request. You may receive an “invalid_field_map” error initially.
  4. Map Request Fields:
    • Return to the Webhook Listener Trigger settings in Groundhogg.
    • Click “Map Request Fields” and assign incoming fields (e.g., first_name) to corresponding contact fields (e.g., First Name).
    • Save changes.
  5. Retest the Webhook:
    • In Postman, resend the POST request.
    • Verify a “Success” response, indicating the contact was added to the flow.
  6. Finalize Settings:

Example Use Case

A business uses a third-party form builder to collect leads on their website. They configure a Webhook Listener Trigger in Groundhogg to receive form submission data, mapping fields like name and email to contact records. When a lead submits the form, the webhook sends the data to Groundhogg, triggering a flow that applies a “New Lead” tag and sends a welcome email, streamlining their lead nurturing process.

FAQs / Troubleshooting

Q: Why do I get an “invalid_field_map” error when testing?
A: This error occurs if request fields are not mapped to contact fields. Ensure you’ve configured the field mappings in the trigger settings and saved changes before retesting.

Q: What data formats does the Webhook Listener accept?
A: It accepts POST requests with JSON or x-www-form-urlencoded body encoding.

Q: Can I test the webhook without Postman?
A: Yes, you can use any API testing tool or send a POST request programmatically from your application. Postman is recommended for its ease of use.

Q: How do I troubleshoot a failed webhook request?
A: Check the request format, ensure the Listener URL is correct, and verify field mappings. You can also inspect the “Request” section in the trigger settings to see the received data.

Was this helpful?

Let us know if this document answered your question. That’s the only way we can improve.