How to Connect OptinMonster with a Webhook

You can now connect OptinMonster with a webhook to receive your optin’s submitted data. This allows you to customize the data you retrieve and how it’s stored.

NOTE: This feature is for Advanced Users. Due to the custom nature of webhooks, at this time we are unable to provide support related to your custom implementation.

This documentation is provided with the assumption that you know how to utilize webhooks, or are working with a developer who is familiar with webhooks.


Data Structure

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

{
    "lead": {
        "email": "hello@optinmonster.com",
        "firstName": "Archie",
        "lastName": "Monster",
        "phone": "888-888-8888",
        "ipAddress": "1.2.3.4",
        "referrer": "https://optinmonster.com"
    },
    "campaign": {
        "id": 440725,
        "title": "My Lightbox Optin",
        "slug": "zqw3qfcie3ogtanf"
    }
}

Your webhook can receive the following lead data:

  • lead
    • email – the Email Address submitted
    • firstName – the First Name submitted (if First Name field is enabled in your optin)
    • lastName – the Last Name submitted (if First Name field is enabled in your optin)
    • phone – the Phone submitted (if Phone field is enabled in your optin)
    • ipAddress – the IP Address of the computer the lead was submitted from
    • referrer – the URL of the page the optin was submitted from
  • campaign
    • id – the ID of the optin campaign submitted
    • title – the Title of the optin campaign submitted
    • slug – the Slug of the optin campaign submitted

Integrating Your Webhook with OptinMonster

Step 1: Integrations Tab

In the optin builder, select the Integrations tab to view the Integrations panel.

Select the Integrations tab in the optin builder to begin connecting your Email Service Provider to OptinMonster.

If this is your first time connecting an integration to your optin you’ll see a “New Integration” item in the Integrations panel of the builder. Select that to begin connecting your webhook.

Select the New Integration item to begin connecting your Email Provider to OptinMonster.

Next, select Webhook from the Email Provider dropdown.

Select the Email Provider from the dropdown list to begin connecting them to your OptinMonster optin.

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 with Webhook button.

Add your webhook URL and select the Connect with Webhook button to complete the integration.

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

Once connected to your Webhook, OptinMonster will display a confirmation message and information about the JSON data that is sent with each optin.

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


FAQs

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.

Already using Zapier? See our guide on How to Connect OptinMonster with Zapier to get started using OptinMonster with Zapier!

Additional documentation related to Zapier:


Q: I can only enable the ‘Name’ field in my optin, 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 Optin panel of the builder to collect both the First and Last Name.

You can enable the Name field for your optin in the Optin panel of the builder.