How to Connect OptinMonster with a Webhook

Do you want to configure a webhook for your campaign? It’s easy with OptinMonster’s webhook integration! Here we’ll show you how to connect a webhook to your OptinMonster campaign to easily receive your campaign’s submitted data. Our Webhook integration requires a Pro subscription.

Data Structure

Lead data will be formatted via JSON and resemble the example below:

   "lead": {
      "email": "",
      "firstName": "Archie",
      "lastName": "Monster",
      "phone": "888-888-8888",
      "ipAddress": "",
      "referrer": ""
   "campaign": {
      "id": "nppjcagohkl4bx3w1zln",
      "title": "Demo (Popup)",

Your webhook can receive the following lead data:

  • lead
    • email – the email address submitted
    • 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
  • campaign
    • id – the unique ID of the campaign submitted
    • title – the title of the campaign submitted

Integrating Your Webhook With OptinMonster

Step 1: Add an Integration

If you’re uncertain how to add your integration, you can follow our guide for connecting to Email Service Providers and CRMs.

Next, select Webhook from the Email Provider dropdown.

Webhook Integration

Step 2: Enter Your Webhook URL

Next, paste your Webhook URL into the corresponding field. Don’t forget to add a unique Account Label for easy identification. Then, select the Connect to Webhook button.

Connect to Webhook

Once connected, you’ll see the following message in the Integrations panel:

Webhook Lead Data

That’s it! You’ve successfully connected your Webhook to OptinMonster!

Do you want to use Webhooks to connect your campaigns with Zapier? See our guide on how to connect OptinMonster with Zapier to get started!


Q: I’m new to Webhooks, how can I find out more about them?

A: Some good resources to learn more about the basics of webhooks include:

Q: I’d like to use Webhooks, but am not technical. Can I use Webhooks without writing any code?

A: Yes! Zapier allows you to get started using Webhooks without having to know how to code anything. Please note that Zapier is a paid service, however they do provide a free trial if you want to see if their tools suit your needs.

See our documentation for more ways to connect OptinMonster and Zapier:

Q: I can only enable the ‘Name’ field in my campaign, how do I collect the First and Last Names?

A: 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.

Name Field

Q: Is there a way to provide a custom error message from my Webhook?

A: If you manage the Webhook server and response, then you can specify your own error message via the Webhook response. If the response contains a “om_error_message” parameter, the error message will show that instead of the default “There was an error submitting your data.”.

Q: Is there a way to provide response data from my Webhook?

A: If you manage the Webhook server and response, then you can send back arbitrary data via the Webhook response. If the response contains a “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:

document.addEventListener('om.Optin.success', function( evt ) {
	if ( '<YOUR SLUG>' !== ) {
	var response = evt.detail.response;

	if ( response && && ) {		
		document.addEventListener('om.Action.redirect', function( evt ) {
			evt.detail.Action.options.url =;