OptinMonster offers seamless integration with webhooks using our native integration.
In this article, you’ll learn how to connect a webhook to OptinMonster.
All subscription plans can add custom forms using the Form Embed block.
Before you start, as a best practice we recommend you also connect your campaigns to Monster Leads as a backup.
When you create a campaign in OptinMonster that you intend to collect leads with you’ll want to integrate with one or more services to send those leads to.
To send those leads to a webhook, follow these steps:
- Navigate to the Integrations view in the campaign builder, search for and select Webhook.
- Next, enter a Webhook Account Name (*internal use only) and enter the Webhook URL into the appropriate fields, then select the Connect to Webhook button.
*The Webhook Account Name can be anything that helps you identify the specific integration within OptinMonster. It’s possible to add more than one Webhook integration to your account and this is an easy way to differentiate between them when assigning integrations to individual campaigns.
- Once connected, you’ll be provided with an example of how Lead data will be submitted via JSON to your Webhook URL.
- The same section of your integration will also confirm the Webhook URL data submits to.
- Optional: You can also configure a List Name, assign Tags, additional Data, and configure the Store IP Addresses? (Turn off for GDPR) option.
- When you’re finished, Save your campaign.
Lead data will be formatted via JSON and resemble the example below:
Your webhook can receive the following lead data:
firstName– the first name submitted (if name field is enabled in your campaign)
lastName– the last name submitted (if name field is enabled in your campaign)
phone– the phone submitted (if phone field is enabled in your campaign)
ipAddress– the IP Address of the computer the lead was submitted from
referrer– the URL of the page the campaign was submitted from
timestamp– the timestamp when the campaign was submitted.
list– list name (optional)
tags– tags to assign to lead (optional)
data– additional custom data that you want associated with each lead (optional)
id– the unique ID of the campaign submitted
title– the title of the campaign submitted
page_url– the URL of the page where campaign converted
referrer_url– the URL of the page where user landed on converted page
pages_visited– total number of pages visited by the user in current visit
time_on_site– total time on site spent before converting
visit_timestamp– time of conversion
page_title– title of the page
campaign_name– name of the campaign
form_email– email address submitted
coupon_label– coupon code label
coupon_code– coupon code that was displayed to user on conversion
You can also pass Smart Tag data along with the lead data using our Webhook integration. Learn more about Smart Tags
Add Extra Fields
Get started using Field Mapping with Webhooks. Before you begin using Field Mapping with Webhooks, please consider the following: To send emails automatically to new leads you’ll want to configure email automations within the Email Service Provider account your Webhook sends data to. We strongly recommend you test the optin form before publishing your campaign to ensure it is working as you expect. Before you begin, please be aware of the following details when testing Webhook integrations: Get started testing with the Live Site Inspector tool. If you are configuring a Gamified spin-to-win campaign, Spin-a-Wheel support is automatically enabled. This will pass the Coupon Label and Coupon Code to your Webhook in the If you’re serious about jumpstarting your website business growth, then get started with OptinMonster today!
meta key of the JSON payload.
smart_tags data is being captured as you expect. The Live Site Inspector tool is the testing feature you’ll want to use for test-submitting an optin form before you’ve Published a campaign live to your site.
smart_tags key with each lead.
Get started using Field Mapping with Webhooks.
Before you begin using Field Mapping with Webhooks, please consider the following:
To send emails automatically to new leads you’ll want to configure email automations within the Email Service Provider account your Webhook sends data to.
We strongly recommend you test the optin form before publishing your campaign to ensure it is working as you expect.
Before you begin, please be aware of the following details when testing Webhook integrations:
Get started testing with the Live Site Inspector tool.
If you are configuring a Gamified spin-to-win campaign, Spin-a-Wheel support is automatically enabled. This will pass the Coupon Label and Coupon Code to your Webhook in the
If you’re serious about jumpstarting your website business growth, then get started with OptinMonster today!
Our conversion experts will design 1 free campaign for you to get maximum results – absolutely FREE! Click here to get started →
Can I send leads to more than one Webhook URL?
Yes! See our Lead Sharing guide to accomplish this.
I’m new to Webhooks, how can I find out more about them?
Some good resources to learn more about the basics of webhooks include:
I’d like to use Webhooks, but am not technical. Can I use Webhooks without writing any code?
Yes, in that instance we recommend using our Zapier integration and configure the Zap to send data from OptinMonster to Webhook. That is the best approach to get started using Webhooks without having to know how to code anything.
See our documentation for more ways to connect OptinMonster and Zapier:
- How to Connect OptinMonster with Zapier
- How to Add Subscribers to a Google Spreadsheet with Zapier
- How to Add Subscribers to Google Contacts with Zapier
- How to Receive Leads to Your Email with Zapier and OptinMonster
- How to Send Subscribers an Email from Gmail with Zapier and OptinMonster
- How to Send Text Messages to New Subscribers using Twilio and Zapier
- How to Receive Text Messages of New Subscribers using SMS by Zapier
How do I collect the First and Last Names?
OptinMonster will automatically detect if someone has entered their first and last names into the Name input field. You only need to enable the Name field in the Fields Element to collect both the First and Last Name.
How can I update the Webhook URL the campaign data is sent to for my integration?
To change the Webhook URL your integration sends data to, follow these steps:
- Navigate to the OptinMonster Account > Integrations page.
- From the Integrations page, select the Configure button for your Webhook integration.
- Locate the specific Webhook integration you want to edit from the list and select the Edit button.
- Enter the new Webhook URL into the second input field to change where JSON data is sent for this integration.
- When you’re finished, selectthe Update Integration to Webhook button to apply the changes to all campaigns using this specific Webhook integration.
Is there a way to provide a custom error message from my Webhook?
If you manage the Webhook server and response, then you can specify your own error message via the Webhook response. If the response contains the “om_error_message” parameter, the error message will show that instead of the default “There was an error submitting your data.” message.
Is there a way to provide response data from my Webhook?
If you manage the Webhook server and response, then you can send back arbitrary data via the Webhook response. If the response contains the “om_response_data” parameter, this will be passed along to the webhook request response in the
data parameter. Why would you want this? One example would be to modify the redirect URL for your form action.
Send the following response from your webhook:
And place the following on your site to automatically use the response redirect data for a given campaign:
How can I allowlist webhook requests from OptinMonster IP addresses?
Our webhooks will be sent from one of the following IP addresses:
How can I force the webhook to connect?
Occasionally, the method we use to authenticate and connect your webhook URL may fail. If you would like to force the connection, this is possible using a special query parameter on your webhook URL,
If your webhook URL already has query parameters, you can add it like this:
ignore_connection_failure=1 paramater will be remove from the URL during the webhook requests, but we use this flag to determine if we should force the connection.
The campaign is capturing leads but shows 0 conversions in analytics.
Confirm that conversion tracking is turned on for the submit button in your campaign. See our guide on How to Enable Conversion Tracking.