Advanced Features: Introduction To Webhooks
Webhooks is included in the basic plan of Groundhogg and you will need to install the advanced features plugin to use webhook's.
Groundhogg provides webhooks that you can use to communicate with other software or instances where Groundhogg is located on another website.
You can view a working example of the webhook in Groundhogg's office hours #42.
There are two types of webhooks:
Webhook (Action)
This Webhook step allows you to communicate with other software tools via HTTP methods.
Webhooks can only be created through the funnel builder.
To create a new Webhook add a new step to the funnel and select the Webhook icon from the Actions tab.
Once the webhook step has been added to the funnel you will see this configuration screen.
URL: Enter the target URL of your webhook here. You can test the webhook tool by using http://webhook.site/
HEADERS (optional): Add any authentication information required by the target platform.
PARAMS (optional): Add any POST information required by the target. For example the email address of the contact.
To pass contact information to the target add Params with key-value pairs. For example, passing first, last and email would look like this.
If your webhook target expects a JSON request, then you can optionally choose to send the request as a JSON payload.
To test your webhook with contact data, hover over the URL section and click Send Test. That will send a test to your webhook so you can know if it's working or not.
*You can pass a "bearer token" in the headers.
Extend the timeout on a webhook
Using the http_request_timeout
filter allows you to modify the default timeout duration for HTTP requests made by WordPress. This can be useful when you want to increase or decrease the time allowed for requests to external APIs or services.
// Modify HTTP request timeout function custom_http_request_timeout($timeout) { // Set your desired timeout value in seconds (e.g., 30 seconds) $custom_timeout = 30; // Change this value to your preferred timeout return $custom_timeout; } add_filter('http_request_timeout', 'custom_http_request_timeout');
Webhook Listener (Benchmark)
The webhook listener is an important part of the webhook. Using webhook listener you can send information to Groundhogg.
It's a benchmark so it's used to start an automation flow in the funnel.
You can configure this step by sending the test data from your other source and mapping data with the appropriate field.
Once the step is configured successfully you will be able to send data to Groundhogg.